-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css2] Margins shouldn't collapse through replaced element #9006
Comments
Agreed. I'd perhaps add an "and is not a replaced element" after "does not establish a new block formatting context". |
Or "top and bottom margins of a non-replaced box that does not establish a new block formatting" |
Arguably replaced elements establish their own formatting contexts - also the text should likely be just "independent formatting context" instead of "block formatting context" |
Sure but CSS2 doesn't have that term. Just like when it says "vertical margins" and we understand "block margins", when it says "new block formatting context" we should treat it as "independent formatting context".
Not opposed to that, but other parts of CSS2 don't make that assumption and handle replaced elements explicilty, e.g. https://drafts.csswg.org/css2/#floats
|
OK it's already on Display 3: https://drafts.csswg.org/css-display-3/#replaced-element
CSS2 can still be clarified, but not sure if it's worth it. |
No browser lets the top and bottom margins of the replaced element to collapse through it.
The conditions are: https://drafts.csswg.org/css2/#collapsing-margins
The interior of replaced elements is outside the scope of CSS, so I guess UAs might establish an independent formatting context if they want. But probably this shouldn't be left up to the UAs, the spec should explicitly handle replaced elements.
The text was updated successfully, but these errors were encountered: