View Full Version : Overlap

11-30-2005, 01:12 PM
Using the code below the links navigation bar doesn't follow the header in Firefox, it overlaps it. Any ideas on how to solve this?

<style text="text/css">
body { padding:0; margin:0; }
#header {clear:both;width:100%;
<div id="header">
<div style="float:left; width:50%;">
<a href="index.php"><img src="/images/Logo.gif" border="0" alt="logo" /></a>
<div style="float:right; width:50%;">
<img src="/images/468x60.gif" border="0" alt="banner" />
<div style="border:1px solid #CCCCCC;text-align:center;width:100%;padding:0;margin:0;"> Links Navigation to go here</div>

11-30-2005, 03:14 PM
Because the "header" div only contains floated elements, it collapses, leaving the navigation div to move up under the content it precedes it.

To force the header to encompass the two floats, either include a little non-floated and cleared element after the two floated divs, or float the "header" div itself; this "magically" causes it to encompass the floated content.