Previous Message
Next Message

Re: [css-d] Body Margin

Sent by Eric A. Meyer on 29 January 2002 12:12


At 12:31 -0500 1/29/02, David Gilden wrote:

><body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" 
>marginheight="0">
>
>Is this equivalent to:
>
><style type="text/css" media="screen"><!--
>body { margin:0;}
>--></style>

    Almost.  To be absolutely sure you get the effect you're seeking, 
you would want to declare:

    body {margin: 0; padding: 0; border-width: 0;}

A browser might choose to recreate the "offset" between browser 
window edge and page content using padding instead of margin, for 
example.

>and is this the more correct as well,

    It's more CSS-based and forward compatible.  The HTML-based way is 
now non-standard and only backward compatible.

--
Eric A. Meyer (http://www.meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff
Previous Message
Next Message

Message thread: