I want to remove all indentation from ul
. I tried setting margin
, padding
, text-indent
to 0
, but no avail. Seems that setting text-indent
to a negative number does the trick - but is that really the only way to remove the indentation?
Set the list style and left padding to nothing.
ul {
list-style: none;
padding-left: 0;
}
ul {
list-style: none;
padding-left: 0;
}
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
</ul>
To maintain the bullets you can replace the list-style: none
with list-style-position: inside
or the shorthand list-style: inside
:
ul {
list-style-position: inside;
padding-left: 0;
}
ul {
list-style-position: inside;
padding-left: 0;
}
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
</ul>