new to CSS and still learning here, encountered a problem with IE 7 inserting what looks to be about an extra 5 pixels between the end of my <div> and the following image. this results in the page background showing through and is very annoying. The page looks fine in Firefox, safari on mac, etc.
html:
<!-- end #container --></div>
<img src="images/botRound.jpg" width="780" height="11" border="0" />
<div id="copyright">
<p><span class="style13">©2008 Cig Jan Products Ltd. - All Rights Reserved</span></p>
</div>
</body>
</html>
css:
@charset "UTF-8";
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.oneColFixCtrHdr #container {
width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColFixCtrHdr #header {
background: #FFFFFF;
}
.oneColFixCtrHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.oneColFixCtrHdr #mainContent {
padding: 0 0px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
margin: 0;
background: #FFFFFF;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
}
.oneColFixCtrHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.oneColFixCtrHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 0px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}
div#mydiv p {
padding:1em;
}
if anyone has any insight i would be eternally grateful. new to this stuff and no clue really why this is happening… googled around and found stuff on negative margins, collapsing margins, etc. but all my fooling around hasn’t fixed it.
thanks for any help!