Re: [csswg-drafts] [CSS2] Adjoining margins when parent min-height is non-zero

It looks that per [current CSS2.x edition](https://www.w3.org/TR/CSS22/box.html#collapsing-margins) (incorporating the Errata from 2012) the bottom margins of the box with `height: auto; min-height: <non-zero>` and its last in-flow child are explicitly meant to collapse:

> The bottom margin of an in-flow block box with a 'height' of 'auto' collapses with its last in-flow block-level child's bottom margin, if:
> - the box has no bottom padding, and
> - the box has no bottom border, and
> - the child's bottom margin neither collapses with a top margin that has clearance, nor (if the box's min-height is non-zero) with the box's top margin.

and in your example the child's bottom margin doesn't collapse with the box's top margin (since the child's height is not zero), so all three conditions are satisfied.

However, this is _really very counter-intuitive_ and sometimes confusing (related issue: #2171), so, given that different implementations already exist, maybe it makes sense to rethink this particular case of margin collapsing?

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2607#issuecomment-383583890 using your GitHub account

Received on Monday, 23 April 2018 13:55:25 UTC