I'm running into a weird issue that I've never noticed before. I have the following code:
<div class="feedback">
<span> Was this helpful?</span>
<ul>
<li>
<a href="#">Yes</a>
</li>
<li>
<a href="#">No</a>
</li>
<li>
<a href="#">No</a>
</li>
</ul>
</div>
Very simple block of code. Ignore the second no, as it's literally only there to give me a third li
to help me figure this out. Now, here's the CSS...
div.feedback {
position: relative;
}
span {
float: left;
}
li {
display: inline-block;
padding: 0;
margin: 0;
border-left: 1px solid #000
}
Now, here's what's happening:
See the extra spacing that's seemingly coming from nowhere? I moved to border-right
just to test it, and got even more inconsistent results:
Now, the 3rd LI has 0 padding
and margin
, as it should. The other two still have a spare space.
Lastly, the browser comprehends the proper height
and width
of the li
, and attributes no margin
or padding
to it. According to the browser, the text should be smashed up against the border, as I also expect.
Can someone please explain what this extra 3-5 pixels of spacing is on the right of the text?