Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<link rel="author" title="Javier Contreras" href="mailto:javiercon@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-gaps-1/">
<link rel="help" href="https://drafts.csswg.org/css-grid-3/">
<style>
body { margin: 0; }
.lanes {
display: grid-lanes;
grid-template-columns: repeat(3, 60px);
grid-lanes-pack: dense;
flow-tolerance: 0;
gap: 10px;
background: #cdd5e0;
width: max-content;
}
.lanes > div {
background: #5b8def;
color: #fff;
font: 600 12px/1 sans-serif;
}
.lanes > div.c1 { grid-column: 1; }
.lanes > div.c2 { grid-column: 2; }
.lanes > div.top { height: 20px; }
.lanes > div.tall { height: 80px; }
.lanes > div.spanner {
grid-column: 1 / span 2;
height: 40px;
background: #8a6df0;
}
.lanes > div.packed { height: 30px; background: #1f9d6b; }
.row-rule { position: absolute; height: 0; border-top: 4px solid gold; }
</style>
<div class="lanes">
<div class="c1 top">1</div>
<div class="c2 tall">2</div>
<div class="spanner">3 (span 2)</div>
<div class="c1 packed">4 (dense)</div>
</div>
<div class="row-rule" style="top: 23px; left: 0; width: 60px;"></div>
<div class="row-rule" style="top: 83px; left: 0; width: 60px;"></div>
<div class="row-rule" style="top: 83px; left: 70px; width: 60px;"></div>