W3C home > Mailing lists > Public > www-style@w3.org > September 2008

Re: [CSS21] Collapsing Margins

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Wed, 10 Sep 2008 13:06:24 +0200
Message-ID: <48C7AA30.6010404@lachy.id.au>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: Bruno Fassino <fassino@gmail.com>, Arron Eicholz <Arron.Eicholz@microsoft.com>, www-style <www-style@w3.org>

Alex Mogilevsky wrote:
> Have you changed the test recently?

> It seems the red moved since this thread started,

Yes, the test was originally invalid and I fixed it.

> The expected behavior is as follows
> * "outer" has min-height of 21px * "inner" is 20px tall, therefore
> "outer" would be at most 20px tall if not for min-height, which means
> "inner" bottom margin doesn't collapse with "outer" bottom margin *
> Since "inner" bottom margin doesn't collapse with the parent, it
> contributes to the height of the parent * "outer" height therefore
> must be 100px * "green" div then is positioned at 100px

I have to agree with Bruno about this, since the 3rd step in 10.7 does 
return 21px as the height.  Since 'min-height' is used as the computed 
value of 'height' in that that step, the result is the same as if 
'height' itself had been set to 21px.  I've added 2 more tests to 
demonstrate this using 'height' instead of 'min-height'


> Firefox doesn't include "inner" bottom margin into "outer" height. 
> Opera and Safari are 1 pixel off. Not sure why. IE8 has correct
> layout.

Opera and Safari are off by 1px due to the same bug they show in 

Lachlan Hunt - Opera Software
Received on Wednesday, 10 September 2008 11:07:04 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:30 UTC