Reputation: 1047
I am trying to make an unordered list where the li elements span the full width of their parent ul. For example, with your browser inspect the following code:
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
You will see that the li elements are not 100% of the line. Do you have any suggestions on how to fix that...
The yellow thing is the ul and the text starts like 50px to the right.
Upvotes: 0
Views: 795
Reputation: 208040
The list items (<li>
) are taking up 100% of the space they're in. It's the default padding
on the <ul>
that you're seeing. Remove it with ul {padding:0}
ul {padding:0}
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
Upvotes: 3