PDA

View Full Version : Margin in IE6


Soad
07-31-2007, 05: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

Thanks

d a v e
07-31-2007, 07: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; /* */
}

domedia
07-31-2007, 11: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, 04: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 :)

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

{margin: 0; padding: 0;}

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

domedia
07-31-2007, 05:46 PM
Got curious and looked it up. It's a hack to hide the CSS rule from NN4.
http://centricle.com/ref/css/filters/

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, 08: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;}

domedia
08-01-2007, 12:43 AM
I actually think the 'padding' is a 'be nice to Opera' thingie, but I could remember wrong.