View Full Version : Margin in IE6

07-31-2007, 04:54 AM
www.nasaplant.com views fine in Firefox but in IE6 on the main index page there is a margin at the top how can I get IE6 to display correctly


d a v e
07-31-2007, 06:13 AM
you need to zero the padding as well as the margins

try body {
padding: 0;
margin: -10px 0 0 -10px;
/*/*/margin: 0 0 0 0; /* */

07-31-2007, 10:15 AM
dave, what browser is the hack for?
I've always just used body {margin: 0; padding: 0;} and it's seemed to work in all relevant browsers.

d a v e
07-31-2007, 03:30 PM
can't remember where i got that from ;) mught have been the dreamweaver forum (the old Macromedia newsgroup) i think it might have been for opera, or then ie6... if it works without then leave it out :)

07-31-2007, 04:17 PM
I have always used

{margin: 0; padding: 0;}

as well and had no problems. I've never even seen that code Dave.

07-31-2007, 04:46 PM
Got curious and looked it up. It's a hack to hide the CSS rule from NN4.

I have not cared about NN4 for some years, so I've never seen the hack in action til now.

d a v e
07-31-2007, 07:31 PM
thanks! didn't realise it was *that* old: i haven't bothered with nn4 quite some while too ;) i just had that snippet hanging around from ages ago. guess i'll go back to just the basic {margin: 0; padding: 0;}

07-31-2007, 11:43 PM
I actually think the 'padding' is a 'be nice to Opera' thingie, but I could remember wrong.