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

Re: Margin collapsing and overflow: hidden

From: Michael Day <mikeday@yeslogic.com>
Date: Mon, 08 Oct 2007 10:45:18 +1000
Message-ID: <47097D9E.4070008@yeslogic.com>
To: Bruno Fassino <fassino@gmail.com>
CC: www-style@w3.org

Hi Bruno,

> And about Opera it should be noted that _any_ empty div (even without
> overflow) stops the collapsing between a preceding and a following sibling,
> so Opera doesn't seem too realiable here.

I'm not seeing this in Opera 9, if I change hidden to visible the gap 
between paragraphs gets smaller as the margins collapse.

> With a simpler construction with just two siblings, the addition of
> overflow:hidden doesn't seem to stop the collapsing in any browsers.

Are you sure? Try this test document in Opera 9 and Firefox 1.5:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<p>Hello!</p>
<div style="overflow: hidden"></div>
<p>Hello!</p>
</body>
</html>

There should be a larger than usual gap between the two paragraphs, 
which returns to normal if hidden is changed to visible.

Best regards,

Michael

-- 
Print XML with Prince!
http://www.princexml.com
Received on Monday, 8 October 2007 00:45:40 GMT

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