W3C home > Mailing lists > Public > www-style@w3.org > October 2007

Margin collapsing and overflow: hidden

From: Michael Day <mikeday@yeslogic.com>
Date: Sun, 07 Oct 2007 15:11:47 +1000
Message-ID: <47086A93.2080003@yeslogic.com>
To: www-style@w3.org

Hi,

In the CSS 2.1 box model section on collapsing margins [1], it states 
that "Vertical margins of elements with 'overflow' other than 'visible' 
do not collapse with their in-flow children".

However, Firefox and Opera appear to disable collapsing with the in-flow 
siblings of the element as well.

For example:

<p>Hello!</p>
<div style="overflow: hidden"></div>
<p>Hello!</p>

The empty div with overflow: hidden will inhibit margin collapsing 
between the two paragraphs. This does not quite seem to be consistent 
with the spec as written, unless I'm missing another clause there.

Should the spec be amended to state "children and siblings"?

Best regards,

Michael

[1] http://www.w3.org/TR/CSS21/box.html#collapsed-through

-- 
Print XML with Prince!
http://www.princexml.com
Received on Sunday, 7 October 2007 05:12:20 GMT

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