Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-flexbox/empty-flex-box-and-margin-collapsing.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="match" href="empty-flex-box-and-margin-collapsing-ref.html">
<meta name="assert" content="This checks that empty flex/grid box's margins do not collapse through.">
<style>
.container {
background: green;
height: 50px;
width: 100px;
}
.root {
margin-top: 0;
margin-bottom: 200px;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div class=container>
<div class=root style="display: flex"></div>
</div>
<div class=container>
<div class=root style="display: grid"></div>
</div>