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

RE: [CSS21] Collapsing Margins

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 9 Sep 2008 23:26:36 -0700
To: Alex Mogilevsky <alexmog@microsoft.com>, Bruno Fassino <fassino@gmail.com>, Arron Eicholz <Arron.Eicholz@microsoft.com>
CC: www-style <www-style@w3.org>
Message-ID: <7C2F64B551D8664AAD94A28DAC37D020632BA4B9D9@NA-EXMSG-C103.redmond.corp.microsoft.com>
Actually no, I'll have to take that back. IE8 is correct

Have you changed the test recently? It seems the red moved since this thread started, so I have attached a copy for reference (with red being where I expect it to be -- at 100px).

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

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

Alex

-----Original Message-----
From: Alex Mogilevsky
Sent: Tuesday, September 09, 2008 10:49 PM
To: 'Bruno Fassino'; Arron Eicholz
Cc: www-style
Subject: RE: [CSS21] Collapsing Margins

I think you are right, collapsing-margins-03 works correctly only in firefox.

-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of Bruno Fassino
Sent: Tuesday, September 09, 2008 1:31 PM
To: Alex Mogilevsky
Cc: www-style
Subject: Re: [CSS21] Collapsing Margins


On Tue, Sep 9, 2008 at 9:26 PM, Alex Mogilevsky wrote:
>
> IE8 also handles this correctly (although there is a thin red stripe in the bottom, from an unrelated bug).
>
> [1] http://lachy.id.au/dev/css/tests/adhoc/collapsing-margins-01.html
> [2] http://csswg.inkedblade.net/spec/css2.1#issue-14


IE8 beta 2 does not seem to render correctly this:

http://lachy.id.au/dev/css/tests/adhoc/collapsing-margins-03.html

the green box should be just 21px below the top of the page.

It also does not render correctly the first two test cases here

http://brunildo.org/test/collminmax.html

(it seems that in presence of min-height there is never collapsing and
the bottom-margin of the last child is always "enclosed".)


--
Bruno Fassino http://www.brunildo.org/test



Received on Wednesday, 10 September 2008 06:27:26 GMT

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