W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: [CSS2.1] collapsing margins min or max height

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 16 Mar 2011 09:10:07 -0700
To: Alan Gresley <alan@css-class.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <20110316161007.GA26735@pickering.dbaron.org>
On Tuesday 2010-09-21 22:21 +1000, Alan Gresley wrote:
> Was : [CSSWG] Minutes and Resolutions 2010-09-08
> >  plinss: Issue 159.
> [snip]
> >  dbaron: There's a bullet point about "bottom margin of element and bottom
> >          margin of last in-flow child" and the one after that - the
> >          problem with those two is that they change the latter changes
> >          the conditions of the former in the situation where all the
> >          margins collapse with each other.
> >  fantasai: I don't understand.
> >  dbaron: The question is, does the bottom margin of a last child collapse
> >          with the bottom margin of its parent?
> >  dbaron: In particular, the case where the parent has non-zero min-height,
> >          but auto height.
> Gecko is the only impls that does not collapse the bottom margin of
> a child when the parent's (of auto height) min-height exceeds the
> used height of the child. All other impls collapses the bottom
> margins regardless of the min-height of the parent. This came up as
> CSS2.1 issue 79 back in 2008,
> <http://lists.w3.org/Archives/Public/www-style/2008Nov/0109.html>
> from this message.
> <http://lists.w3.org/Archives/Public/www-style/2008Sep/0081.html>
> I believe the current behavior as seen in Gecko is what is suggested
> by the prose in the text. Neither bottom margins in example 3 or 4
> in this test case are adjoining.
> <http://css-class.com/test/css/box/margins/collapsing-with-min-height.htm>
> Same here where Gecko that does not collapse the bottom margin of a
> child when the parent's min-height exceeds the used height of the
> child.
> <http://www.brunildo.org/test/collminmax.html>

I believe your observations about implementations are correct, but
that your statement of what the spec requires is incorrect, at least
as of the latest editor's draft:
which says the following:
 * Nonzero min-height does NOT prevent collapsing of a block's
   bottom margin with the bottom margin of its last child.
 * Nonzero min-height DOES prevent collapsing of a block's own top
   and bottom margins, UNLESS the block's top margin collapses with
   its last child's bottom margin.  (The "UNLESS" bit comes from the
   statement that "A collapsed margin is considered adjoining to
   another margin if any of its component margins is adjoining to
   that margin.")

Also see the comments on (MC1) in

If you do not accept this resolution, please let us know by March
18, 2011.


L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Wednesday, 16 March 2011 16:10:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:44 UTC