Re: totally collapsed

On Thursday 2004-07-01 22:38 -0700, Andrew Fedoniouk wrote:
>  p { border: blue solid 1px; }
> <body>
> <p>paragraph</p>
> </body>
> 
> margins of the paragraph are collapsed ,
> 
> and here
> 
>  p { border: blue solid 1px; margin:1em }
> <body>
> <p>paragraph</p>
> </body>
> 
> margins of the paragraph are not collapsed.

I don't think what you're seeing has anything to do with collapsing
margins.

> I am testing this in Internet Explorer and Gecko. 

I assume you're testing Gecko in quirks mode [1].  If that's the case,
it has UA stylesheet rules applied in quirks mode that remove the
default margins from the first child of BODY or TD (not actually
:first-child, though, but instead a selector that doesn't match an
element that is the first child element but is preceded by text).  This
is really a minimally sufficient imitation (since it doesn't account for
a P inside a DIV, etc.) of of pre-CSS margin handling (and what
IE/Windows does), where BODY and TD absorb the default top margins of
their first child.

-David

[1] http://www.mozilla.org/docs/web-developer/quirks/

-- 
L. David Baron                                <URL: http://dbaron.org/ >

Received on Friday, 2 July 2004 04:00:26 UTC