Forum Moderators: not2easy
The navbar is a ul with margin: 0; padding: 0 0 0 8em;
The li elements are float: left; margin: 0;
The a elements (for each li) are display: block; padding: .1em .5em; padding: 1px outset #4e5999;
The banner has a border, and a background-image, and IS NOT floated!
Up to now, I have placed a kludge clearing div after the nav bar (1px, clear: both, display: block; ...that sort of thing).
Without the kludge, the navbar dips below the containing div at least half an em.
Seems sort of a cheat. Is there, as I suspect, a better way? I.e., what am I doing, wrong? Teach me, oh masters!
ul#navigate a { background: #fefefe url("nav3.png") repeat-x; border: 1px outset #4e5999; color: #000; display: block;
font-weight: normal; padding: .1em .5em; text-decoration: none; }
ul#navigate li a:hover, ul#navigate li a:active, ul#navigate li a:focus { background: #d6d6ee url("nav0.png") repeat-x; }
ul#navigate li a#current, ul#navigate li a#current:hover, ul#navigate li a#current:active, ul#navigate li a#current:focus {
background: #aaeeaa url("nav1.png") repeat-x; color: #000; }
ul#navigate li a#projects_list { background: #ededbc url("nav4.png") repeat-x; }
ul#navigate ul li a { width: 8em; }
ul#navigate li { float: left; margin: 0; }
ul#navigate ul li { width: 8em; }
ul#navigate li ul { left: -999em; position: absolute; width: 8em; }
ul#navigate li:hover ul, #nav li.sfhover ul { left: auto; }
...
#banner { background: #fdfffc url("sfmgahdr_new.png") no-repeat fixed; border: 1px outset #4e5999; color: #000;
height: auto; margin: 0 0 .5em 0; padding: 1em; text-align: center; }
...
<div id="banner">
...
<ul id="navigate">
<li><a href="..."/></li>...
<li><a href="..."><!-- suckerfish -->
<ul><li><a href="..."/></li>
<li><a href="..."/></li>
etc....
</ul></li>
etc....
</ul>
</div>
#banner {
background: #eee;
border: 1px outset #4e5999;
color: #000;
margin: 0 0 .5em 0;
text-align: center;padding: 1em 1em 0 1em; /* remove bottom padding it will provided by list once it's contained */
zoom:1; /* contain floats <=IE6 */
overflow: auto; /* contain floats other browsers */
}
If you want (you should) to have CSS that actually validates, put it in a IE only conditional comment (in the html), that way it won't haunt you when IE8 comes out or if zoom one day in a next version of CSS would mean something entirely different.