Re: [CSS21] Collapsing Margins

Bruno Fassino wrote:
> On Tue, Sep 9, 2008 at 5:16 PM, Lachlan Hunt wrote:
>>>> [1] http://lachy.id.au/dev/css/tests/adhoc/collapsing-margins-01.html
>> OK, but what about this case instead.  Given the same HTML, but using this
>> CSS instead:
>>
>> body { min-height: 50px; margin: 0; padding: 0; }
>> div { height: 20px; margin-bottom: 80px; }
>>
>> In this case, the height of the body would be 50px.  But the height of the
>> div plus it's margin is 100px, so should the margin collapse through the
>> body element by 50px?
> 
> No, I think we are again in a case when 8.3.1 excludes collapsing
> (used height NOT equal to what it would have been if min-height were
> its initial value).

Really?  That seems counter-intuitive.  Compare these 2 test cases:

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

The only difference between them is that in the first, the outer div has 
a min-height of 20px (equal to the height of the inner div) and in the 
second, it's 21px.  I expected both to render identically, but if you're 
correct, then the margins should only collapse in the first and the 
second test is invalid.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Tuesday, 9 September 2008 19:08:56 UTC