Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>
CSS Gap Decorations: two nested column subgrids inherit grid-lanes
tracks and paint independent decorations
</title>
<link rel="author" title="Javier Contreras" href="mailto:javiercon@microsoft.com">
<link rel="help" href="https://drafts.csswg.org/css-gaps-1/">
<link rel="match" href="column-subgrid-nested-decorations-ref.html">
<style>
body {
margin: 0;
}
.scene {
height: 320px;
position: relative;
width: 400px;
}
.lanes {
background: #dce6f0;
column-rule: 6px solid #243c9c;
display: grid-lanes;
gap: 20px;
grid-template-columns: repeat(6, 50px);
height: 280px;
padding: 20px 0;
width: 400px;
}
.subgrid {
background: #ffe0a3;
column-rule: 6px solid #b83b00;
display: grid;
grid-column: 2 / span 4;
grid-template-columns: subgrid;
grid-template-rows: 30px 180px 30px;
height: 280px;
row-gap: 20px;
row-rule: 6px solid #9c1755;
}
.inner-subgrid {
background: #c8e8cf;
column-rule: 6px solid #00613c;
display: grid;
grid-column: 2 / span 3;
grid-row: 2;
grid-template-columns: subgrid;
grid-template-rows: repeat(2, 80px);
height: 180px;
row-gap: 20px;
row-rule: 6px solid #005a73;
}
.cell {
background: #087f75;
}
.first-cell {
grid-column: 1;
grid-row: 1;
}
.second-cell {
grid-column: 2;
grid-row: 2;
}
</style>
<div class="scene">
<div class="lanes">
<div class="subgrid">
<div class="inner-subgrid">
<div class="cell first-cell"></div>
<div class="cell second-cell"></div>
</div>
</div>
</div>
</div>