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

[CSS21] Collapsing Margins

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 09 Sep 2008 12:55:33 +0200
Message-ID: <48C65625.6020806@lachy.id.au>
To: www-style <www-style@w3.org>

Hi,
   There is some confusion internally here at Opera as to whether or not 
the CSS 2.1 correctly deals with the case of collapsing margins where an 
element has height of auto and a min-height greater than the bottom 
margin edge of the element's last, in-flow block-level element. The 
issue can be demonstrated using this test case [1].

(Firefox passes that test, but both Opera and Safari fail because they 
seem to collapse the bottom margin through the parent element)

The confusion seems to be regarding this statement in section 8.3.1 
Collapsing Margins [2]:

  "The bottom margin of an in-flow block-level element with a 'height' of
   'auto' and 'min-height' less than the element's used height and
   'max-height' greater than the element's used height is adjoining to
   its last in-flow block-level child's bottom margin if the element has
   no bottom padding or border."

This doesn't seem to adequately cover the case where the min-height is 
greater than the bottom margin edge of the last child element, as in the 
test case, and it is thus unclear whether or not, per spec, the margins 
should collaps in that case (even though, logically, it clearly shouldn't).

So the question is, is the test case correct or not?  Could someone 
please clarify this issue?

[1] http://lachy.id.au/dev/css/tests/adhoc/collapsing-margins-01.html
[2] http://www.w3.org/TR/CSS21/box.html#collapsing-margins

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Tuesday, 9 September 2008 10:56:13 GMT

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