I don't really understand what's going on here.
This is my css and html
#content {
-moz-border-radius:10px;
background:#F0F0F0;
width: 910px;
margin: 0 auto;
clear: both;
}
#content ul {
list-style: none;
padding: 0;
margin: 0;
}
<div id="content">
<ul>
<li>Foo</li>
<li>Bar</li>
<li>Baz</li>
</ul>
</div>
I obtain a grey box containing the items aligned vertically. I want to align them horizontally, and I read I have to put float: left
in the #content ul
selector. If I do so, the grey div box disappears, and the three li
entries stay vertical. If I put the float: left to a #content ul li
selector, the entries are now horizontal, but still the enclosing box disappears.
What am I missing ?