Netscape margin attributes

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have been writing web pages for years using these attributes to the
body tag:

    <body bgcolor=#FFFFFF marginwidth=0 leftmargin=0 marginheight=0

I'm now attempting to bring my pages into compliancy with the latest
css based standards.  I have removed the bgcolor, leftmargin, and
topmargin attributes in favor of style sheet properties:

    BODY {background: #FFFFFF; margin-top: 0px; margin-left: 0px;}

but, what do I do with the Netscape-specific attributes marginwidth and
marginheight?  If these are not set somewhere my pages show a small
white margin on the left and top when viewed in Netscape, Mozilla, etc.

- Bob

Re: Netscape margin attributes

Quoted text here. Click to load it

It has always been wrong. The bgcolor attribute's value is malformed (the
syntax requires quotation marks around it), and the other attributes are
proprietary, nonstandard. Besides, setting background color without setting
text and link colors has always been bad practice.

Quoted text here. Click to load it

That's not quite the same thing.

Quoted text here. Click to load it

To remove all margin-like things, set
html, body { margin: 0; padding: 0; }
This is normally not a good idea, though. Margins are generally useful. The
default margins should be increased a little rather than removed.


Re: Netscape margin attributes

silverbob wrote:
Quoted text here. Click to load it

Do it this way.

<style type="text/css">
body {

Leave the body tag empty. Everything you can do in there can be done
better with style sheets.


best html reference
best style sheet reference html links style sheet links html dom

Site Timeline