Forum Moderators: not2easy

Message Too Old, No Replies

Firefox has -5px top margin? IE7 displays fine

Firefox top margin

         

Tyler Norris

5:50 pm on Oct 29, 2008 (gmt 0)

10+ Year Member



My page displays correctly in IE7, however in firefox I lose about 5px from the top margin. The accuracy is vital.
Anyone else notice this?

---CSS---
#container {
position: relative;
text-align: left;
margin-left: auto;
margin-right: auto;
width: 900px;
padding: 0;
}
#footer {
margin-top: 95px;
margin-right: 270px;
margin-bottom: 0px;
margin-left: 270px;
text-align: center;
padding: 0;
}

#header {
height: 130px;
margin-top: 25px;
padding: 0;
}
h1 {
margin: 0px;
}
#bodymain {
height: 280px;
padding: 0;
}

---HTML---
<body>
<div id="container">
<div id="bodymain"></div>
<div id="header"></div>
<div id="footer"><img src="images/footer.jpg" width="333" height="10"></div>
</div>

</body>
---------

I've read about 50 forum posts and tried several workarounds with no luck.

dreamcatcher

7:55 pm on Oct 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tyler Norris, welcome to Webmaster World. :)

When you say you lose 5px, you mean from the top of the window?

body {
margin:5px;
padding:5px;
}

IE auto pads, Firefox doesn`t. Or set the body elements to 0 and style other elements accordingly. Or did you mean something else?

dc

Tyler Norris

8:11 pm on Oct 29, 2008 (gmt 0)

10+ Year Member



"When you say you lose 5px, you mean from the top of the window?"

--Yes from the top of the browser window

"IE auto pads, Firefox doesn`t. Or set the body elements to 0 and style other elements accordingly. Or did you mean something else?"

--Good bit of info, thanks!

I think I just figured it out. For my footer I used position:fixed.
I knew it was something dumb...this is my first 100% div layout page and I havent quite reached web-nerd status yet. I'll be back ;)

Thanks for your help DC.