-
Notifications
You must be signed in to change notification settings - Fork 642
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] Browsers disagree on margin collapsing when element’s height > content #2171
Comments
It seems that Chrome & co. behave according to the latest CSS2.x spec draft:
In your examples, the bottom margin of the paragraph doesn't collapse with the top margin of the container, thus all three conditions are true and the bottom margins should collapse (though it's not very intuitive). |
https://bugzilla.mozilla.org/show_bug.cgi?id=616339 is the Firefox bug if I'm not mistaken; closing because this isn't a spec issue at this point when there's only one browser disagreeing. |
Live demo: https://codepen.io/simevidas/pen/XVzaPz?editors=1100
In Chrome, Safari, and Edge, the
<p>
element’s bottom margin collapses with<body>
, which causes the<html>
element to expand (to contain<body>
’s newly-acquired margin) beyond100vh
, which in turn causes the scroll bar to appear.In Firefox there is no scroll bar.
Who is right? If
<body>
’s height is set to a value that is larger than its contents, should margin collapsing happen to begin with?The text was updated successfully, but these errors were encountered: