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

Mark Howells mark at mountain.ch
Fri Mar 8 04:15:01 CST 2002

<tip type="Zero body margins with CSS in Netscape 4.x" author="Mark

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}

You can set the margins back to 0 again for other browsers by using
margin:0; in an @imported stylesheet (after the above declaration) for all
other CSS browsers.

Demo online at <http://www.mark.ac/help/noBorder.html>

Hat tip: Char James Tanny <CharJT at helpstuff.com>, via the CSS Discuss list.


Mark Howells

More information about the thelist mailing list