Getting some strange behaviour with nowrap and list items. How do I get the padding to apply to the "Testing 123" li properly in chrome? (The "3" from testing 123 is outside the defined width and encroaches on the padding).
Essentially what I'm trying to achieve is that the ul will be as wide as the widest li, hence the use of float: left. But at the same time I want to keep the dashed border, li padding and keep the text of each item on the same line, hence white-space: nowrap.
HTML:
<ul>
<li>Some</li>
<li>Content</li>
<li>Testing 123</li>
</ul>
CSS:
ul {
float: left;
padding: 0;
margin: 0;
}
li {
padding: 10% 15%;
border-bottom: 1px dashed #333;
list-style-type: none;
white-space: nowrap;
font-size: 2em;
}