wpt / css / CSS2 / box-display / block-in-inlines-in-different-spans-margin-collapse.html

Status: PASS | Duration: 7ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/CSS2/box-display/block-in-inlines-in-different-spans-margin-collapse.html

<!DOCTYPE html>
<title>CSS Test: block-in-inlines in different spans collapse like flat blocks</title>
<link rel="help" href="https://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level">
<link rel="help" href="https://www.w3.org/TR/CSS21/box.html#collapsing-margins">
<link rel="match" href="block-in-inlines-in-different-spans-margin-collapse-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="Block-in-inlines in different sibling spans collapse adjacent margins like flat block siblings would.">
<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).</p>
<div class="container">
    <span><div class="first"></div></span>
    <span><div class="second"></div></span>
</div>

/css/CSS2/box-display/block-in-inlines-in-different-spans-margin-collapse-ref.html

<!DOCTYPE html>
<title>CSS Reference</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<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).</p>
<div class="container">
    <div class="first"></div>
    <div class="second"></div>
</div>