Languages
[Edit]
EN

CSS - remove UL list left margin

4 points
Created by:
Elias999
819

In this short article we would like to show how with CSS remove left margin for UL element (unordered list).

Quick solution:

/* use following style */

ul {
    padding: 0;
}

 Practicel example

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <style>

    ul {
      	border: 1px solid gray;
        padding: 0;  /* <----------------------- required */
    }
    
    li {
      	list-style-position: inside;  /* <------ optional */
    }

  </style>
</head>
<body>
  <ul>
    <li>a</li>
    <li>b</li>
    <li>c</li>
  </ul>
</body>
</html>

 

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

CSS

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join