Forum Moderators: not2easy
Things I checked:
Margin and padding for body are all zero.
#logodiv has margins set to zero.
Here's the CSS:
<style type="text/css" media="screen">
body {
background:#fff;
margin:0px;
padding:0px;
color:#000;
font:x-small/1.5em Verdana,sans-serif;
voice-family: "\"}\""; voice-family:inherit;
font-size:small;
} html>body {font-size:small;}
#header {
float:left;
width:100%;
background:#e1e9ed url("images/bg.gif") repeat-x bottom;
font-size:93%;
line-height:normal;
}
#logodiv {
float:left;
width:100%;
background:#0f4e73;
font-size:93%;
line-height:normal;
}
</style>
<body>
<div id="logodiv">
<img src="images/logo.gif" />
</div>
<div id="header">
<ul>
<li id="current"><a href="index.html">Home/Blog</a></li>
<li><a href="photos/">Photos</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<p>content (remove this p tag and page renders fine) </p>
</body>
I would suspect collapsing margins. Try removing margins from the <p> element and see if that makes a difference.
Meyer has a good article on the subject, Uncollapsing Margins ... [complexspiral.com]
cheers,
gary
You can do one of two things to get rid of it.
h1{ /*whatever element follows the logo*/
clear:left;
}
or
h1{ /*whatever element follows the logo*/
margin-top:0;
}
cEM
on all my h1, h2... and p tags..
...it's best to use the clear property sparingly, especially if you have a float based layout. it's one of those properties that seems simple on the surface but gets quickly complicated when multiple floats and clears start to mix. So my advice is to use the clear ONLY on the element that immediately follows the floated logo. If that element is always an H1, just apply it to the H1. If it is different elements on different pages, you might try creating a class name with the clear styling and apply it to whatever element on each page immediately follows the logodiv...
html for Page 1:
<div id="logodiv"></div>
<h1 class="clear_the_logo">Lorem Ipsum</h1>html for Page 2:
<div id="logodiv"></div>
<p class="clear_the_logo">Lorem ipsum dolor sit amet.</p>css for both:
.clear_the_logo{
clear:left;
}
cEM