The following is quoted from
http://meyerweb.com/eric/articles/webrev/199903.html

"Not all properties are inherited, however. As an example, most of the box
properties (margins, padding, and borders) are not inherited."

To demonstrate this, I've uploaded two files to my server:

http://www.aroundtheblock.net/tutorials/css/index.php
http://www.aroundtheblock.net/tutorials/css/indexNoPM.php

The first page (index.php) has the following in it's stylesheet:

ul, ol, h1, h2, h3, h4, h5, h6, pre, form, body, html, p, div, blockquote,
input, textarea, fieldset
{
  margin: 0;
  padding: 0;
}

For the second page (indexNoPM.php) I changed the above selector to include
only the body:

body
{
  margin: 0;
  padding: 0;
}

There's an obvious difference in the margin and/or padding of the p, h1, h2,
and ul elements on each page.

---
Alyda


> From: Alan K Baker <[EMAIL PROTECTED]>
> Reply-To: Alan K Baker <[EMAIL PROTECTED]>
> Date: Fri, 10 Oct 2008 02:45:10 +0100
> To: css-d <[email protected]>
> Subject: Re: [css-d] IE position problem
> 
> This is simply absolutely true because the 'body' element is the global (and
> only) element until you change something. i.e. Add another element into the
> 'body'.
> 
> Regards, 
> 
> Alan.
>  
> www.theatreorgans.co.uk
> www.virtualtheatreorgans.com
> Admin: ConnArtistes, UKShopsmiths, 2nd Touch & A-P groups
> Shopsmith 520 + bits
> Flatulus Antiquitus
> 
> 
>   ----- Original Message -----
>   From: Serge Krul
>   To: Alan K Baker
>   Cc: css-d 
>   Sent: Friday, October 10, 2008 2:11 AM
>   Subject: Re: [css-d] IE position problem
> 
> 
>     Setting padding and margin to 0 in 'body' will globally remove all padding
> and margins until you change the situation.
> 
> 
>   This is simply not true. body {padding:0; margin:0} will zero margin and
> padding only on the body element. This is in no mean a global reset because
> the padding and margin properties are not inherited. Read the spec:
>   http://www.w3.org/TR/CSS21/box.html#padding-properties
> 
> 
> 
>   Serge Krul
> ______________________________________________________________________
> css-discuss [EMAIL PROTECTED]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> List policies -- http://css-discuss.org/policies.html
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to