Re: [csswg-drafts] [css-grid-3][masonry] Effect of negative bottom margins on running position + dense-packing (#13164)

Based on the discussion regarding negative top margins, the justification of the resolution seems well captured by the pseudo-quote: "We are not making negative margins inconsistent with positive margins, we are only special casing negative sizes".

And the scope of the special case seems covered well by "Negative margins do affect the size of the box", "running position can only move down".

Following that line of thinking, a negative bottom-margin (or top-margin) should be treated as shrinking the size of the box until it reaches a size of 0. At that point, the negative margin may still impact the visual placement of this item, but the size will be 0 in terms of how it impacts the running position.

That all said, in example 1 above:
Running position starts at 0px
Item 1 gets placed at the running position of 0px - running position stays at 0px because its height is 0px (assuming no gaps)
Item 2 gets placed at the running position of 0px - running position increases to 60px (still assuming no gaps)
Item 3 gets placed at the running position of 60px - (mostly) covering the remaining part of Item 1

<img width="811" height="556" alt="Image" src="https://github.com/user-attachments/assets/85b49628-4e05-471c-a7a0-e2ee0a37f028" />

The same would happen in example 2, with the gap starting position being impacted the same way running position is impacted.



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


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

Received on Tuesday, 16 December 2025 19:40:25 UTC