Zygoma,
One common method of clearing floats is to apply {overflow:hidden} to the parent container.
Code:
#header
{
border-color:yellow;
border-width:5px;
border-style:solid;
overflow:hidden; /* add me */
}
You have lots of things floating in your example, but nothing cleared. WHY?
As Dave said, floating things takes them out of the document flow.
When you float something, assume that you also need to "contain" or "clear" that float in some way.
{overflow:hidden} assigned to the parent container is such a way. But what is the "parent container"?
Well, in your example it *could* be the <ul> itself (which would be more appropriate than applying it to #header).
(Without adding {overflow:hidden} to #header (as mentioned above)...)
Code:
#header ul
{
outline:1px solid magenta;
width:100%;
float:left;
overflow:hidden;
}
{overflow:hidden} will "contain" floated objects.
Remember the example from a recent thread about containers.
--hope this helps.
Bookmarks