W3C home > Mailing lists > Public > www-style@w3.org > January 2001

Re: margin vs. padding

From: fantasai <fantasai@escape.com>
Date: Wed, 17 Jan 2001 20:11:27 -0500
Message-ID: <3A6642BF.F905FF26@escape.com>
To: www-style@w3.org
Francisco Brandão wrote:
> 
> i would like to know what´s the real big difference (if there is anyone)
> between the use of margin and padding properties to adjust and control the
> distance between the contents of a page and the surroundings
> top|bottom|left|right margins of the browser area.
> i've tested with both properties on IE5, NS4 and NS6 and it seems to work
> all in the same way ....

Try adding a border and then look. :)
The padding comes between the border and the content; margins
go outside the border.

> is there any preference for one of them on the Body tag in CSS ??

I think padding makes more sense, but I don't know what's preferred.
Received on Wednesday, 17 January 2001 20:10:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:07 GMT