wpt / css / CSS2 / box-display / multiple-block-in-inlines-margins-collapse.html

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

/css/CSS2/box-display/multiple-block-in-inlines-margins-collapse.html

<!DOCTYPE html>
<title>CSS Test: stacked block-in-inlines collapse adjacent margins</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="multiple-block-in-inlines-margins-collapse-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<meta name="assert" content="Three stacked block-in-inlines collapse their adjacent margins like flat block siblings.">
<style>
.container { width: 100px; font: 20px/1 Ahem; }
.a { width: 100px; height: 20px; margin-bottom: 40px; background: green; }
.b { width: 100px; height: 20px; margin-top: 30px; background: green; }
.c { width: 100px; height: 20px; margin-top: 50px; background: green; }
</style>
<p>Three green squares: 40px gap, then 50px gap.</p>
<div class="container">
    <span><div class="a"></div><div class="b"></div><div class="c"></div></span>
</div>

/css/CSS2/box-display/multiple-block-in-inlines-margins-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; }
.a { width: 100px; height: 20px; margin-bottom: 40px; background: green; }
.b { width: 100px; height: 20px; margin-top: 30px; background: green; }
.c { width: 100px; height: 20px; margin-top: 50px; background: green; }
</style>
<p>Three green squares: 40px gap, then 50px gap.</p>
<div class="container">
    <div class="a"></div>
    <div class="b"></div>
    <div class="c"></div>
</div>