Hi,
It's just one of many IE bugs when dealing with floats and you have to make sure things are cleared properly. Your example could also have been fixed by moving the wrap div to encompass the floats like this:
Code:
<div id="wrapper">
<div id="wrapper-inner">
<div id="header" class="clearfix">
<div id="header-left"> LOGO </div>
<div id="header-right"> Header Right </div>
</div>
<div id="navbar" class="clearfix">
<ul id="navbar-left">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
<div id="navbar-right"> image </div>
</div>
<div id="wrap" class="clearfix">
<div id="homepage" class="clearfix">
<div id="homepage-left"> Left Content Goes Here </div>
<div id="homepage-right"> Middle Content Goes Here </div>
</div>
<div id="sidebar"> Sidebar Goes Here </div>
</div>
<div id="footer"> Footer Goes Here </div>
</div>
</div>
That ensures the floats are completely cleared and puts ie back on the right track.
The clearfix method has nothing to do with #navbar. The clearfix method ensures that a parent surrounds the floats but it doesn't affect inner elements which themselves may need to be cleared. The clear:both on #navbar wasn't really necessary but sometimes ie (ie5mac especially) will try and stick a float on the same line and break the layout.
The code you are using seems far to complex and involves wasted empty divs. I dislike adding empty html elements just to add padding. I much prefer using the box model hacks to do this as clean html should be of paramount importance. Also having a div that only holds padding leaves it open to haslayout issues and therefore you would be better off putting the padding on the parent that has a width (which forces haslayout) and then doing a simple box model hack if you want to support older browsers.
Note that margins on static content should have no effect on the float above unless there is something solid in the way. Ie has many bugs in these issues and incorrectly applies a margin-top when it shouldn't.
There isn't a simple answer to your question (although the fixes I gave were simple) except that you just have to make sure that IE has definitely cleared a float before you move on. This is why sometimes the clearer div method is a little more solid. In most cases you can just tweak a couple of things and you are on your way again.
Bookmarks