On 9/08/2012 8:58 AM, Philippe Wittenbergh wrote:

Le 9 août 2012 à 03:41, David Hucklesby a écrit :

Well, this article explains this in terms of a top margin. Bottom margins
behave the same way--but not in all browsers, it seems.

I admit that this continues to confuse me, too, as the behavior is
inconsistent among browsers, as you have found out.

<http://reference.sitepoint.com/css/collapsingmargins>

This is a very special case of margin-collapsing in that the affected div has a 
min-height specified. As I noted in my first reply, this calls for a more complex 
behaviour. And it is in this very special case that browsers don't really agree on 
what to do with the bottom margin of that <p>.

Here is a minimal testcase illustrating what is going on:
http://dev.l-c-n.com/_temp/min-height_margin-b.html

Philippe
--
Philippe Wittenbergh
http://l-c-n.com


This has been discussed and debated on the CSS WG mailing list since 2008. It is CSS2.1 Issue 234 [1] which has now been closed. This will hopefully been dealt with in CSS3. Here is my own testcase (see example 3) [2] and a test case by Bruno Fassino (several of them) [3].

To my knowledge, the CSS WG is leaning toward IE8, IE9 and Opera 11+ behavior (they all behave the same) as being to most appropriate behavior. This would mean that IE8, IE9 and Opera 11+ are doing it correctly.


1. <http://wiki.csswg.org/spec/css2.1#issue-234>
2. <http://css-class.com/test/css/box/margins/collapsing-with-min-height.htm>
3. <http://www.brunildo.org/test/collminmax.html>


--
Alan Gresley
http://css-3d.org/
http://css-class.com/
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to