W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Re: [css2] Margin-Collapsing and min-height

From: Simon Sapin <simon.sapin@exyr.org>
Date: Thu, 24 Apr 2014 17:07:41 +0100
Message-ID: <535936CD.4010704@exyr.org>
To: Robert Hogan <robhogan@gmail.com>, www-style list <www-style@w3.org>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>
On 21/04/2014 21:24, Robert Hogan wrote:
> http://www.w3.org/TR/CSS2/box.html#collapsing-margins says: "the bottom
> margin of a last in-flow child and bottom margin of its parent [adjoin]
> if the parent has 'auto' computed height". Since that is the case here,
> they collapse.

I’m not sure if it’s relevant to your specific case, but CSS 2.1 has 
some errata on this section:

http://www.w3.org/Style/css2-updates/REC-CSS2-20110607-errata.html#s.8.3.1c

> In “8.3.1 Collapsing margins,” add a new item as follows:
>
> Adjoining vertical margins collapse, except:
>
> * Margins of the root element's box do not collapse.
>
> * If the top and bottom margins of an element with clearance are
> adjoining, its margins collapse with the adjoining margins of
> following siblings but that resulting margin does not collapse with
> the bottom margin of the parent block.
>
> * <ins>If the top margin of a box with non-zero computed 'min-height'
> and 'auto' computed 'height' collapses with the bottom margin of its
> last in-flow child, then the child's bottom margin does not collapse
> with the parent's bottom margin.</ins>


You may want to look at the Editor’s Draft instead of the /TR version, 
it has the errata applied in the main text:

http://dev.w3.org/csswg/css2/

-- 
Simon Sapin
Received on Thursday, 24 April 2014 16:08:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC