Re: [csswg-drafts] [CSS2] Clarify margin collapsing behavior (#11306)

So to directly address my [initial question](https://github.com/w3c/csswg-drafts/issues/11306#issuecomment-2511235623) on this: No, the `margin-bottom: 120px` of the first `div` does **not** _collapse through_ the combined `margin-top: 60px` of `div.collapsed` when it collapses with the `margin-top: 10px` of the third `div`.

To summarize simply and explicitly, here's a clear definition of "collapse through":

**"Collapse through"**: The top and bottom margins of an element are said to _collapse through_ if either:

1. The element does not establish a new block formatting context, has a computed `min-height` of `0`, a computed height of `0` or `auto`, and contains no in-flow children.  
   
   **Or**

2. The margins adjoin the combined margin of an intermediary child element, where the child’s margins themselves have collapsed through.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 3 December 2024 08:27:52 UTC