I've got a horizontal un-ordered list, containing 3 items. The list items are a fixed size and width.
When all three <li>
elements have content, everything works as expected.
When all three are empty, everything works as expected.
When one or two items are empty but the other(s) have content, the vertical spacing breaks.
li {
display: inline-block;
padding: 10px 20px;
height: 40px;
width: 100px;
box-sizing: border-box;
border-style: solid;
border-color: black;
border-width: 2px;
text-align: center;
}
<ul>
<li></li>
<li>foo</li>
<li>bar</li>
</ul>
I have two questions.
First, what is going on here, and why? My impression is that, because the <li>
is fixed size, it shouldn't matter whether anything is inside it.
Second, how do I fix it? The obvious way is to add a
to the empty <li>
, but that's not very graceful.
I'm running Chrome 53.0.2785.113 on OSX 10.11.4.