[thelist] [TIP] Solution: Zero body margin with CSS in NN4.x

Mark Howells mark at mountain.ch
Fri Mar 8 08:49:00 CST 2002

>>> To eliminate the need for invalid body attributes [leftmargin="0"
>>> topmargin="0" marginwidth="0" marginheight="0"] in HTML, the following CSS
>>> produces the same effect in Netscape 4.
>>> body {margin: -10px 0 0 -10px}
>> This worked for me in NS 4.x with any negative number:
>> body { margin: -10px}

> What does the negative number do in other browsers?

It puts the left and top edges of the body off the top left corner of the
screen. Try the code from the demo at
<http.//www.mark.ac/help/noBorder.html> in IE without the second CSS
declaration to see what happens.

Mark Howells

More information about the thelist mailing list