Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/CSS2/box-display/block-in-inline-margins-collapse-with-trailing-block.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Test: block-in-inline margin-bottom collapses with following sibling's margin-top</title>
<link rel="match" href="block-in-inline-margins-collapse-with-trailing-block-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="A block-in-inline's margin-bottom collapses with the next block sibling's margin-top.">
<style>
.container { width: 100px; font: 20px/1 Ahem; }
.first { width: 100px; height: 20px; margin-bottom: 40px; background: green; }
.second { width: 100px; height: 20px; margin-top: 30px; background: green; }
</style>
<p>Two green squares separated by a 40px gap (margins collapse, max wins).</p>
<div class="container">
<span><div class="first"></div></span>
<div class="second"></div>
</div>