Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/grid-lanes/subgrid/grid-subgridded-to-grid-lanes/track-sizing/row-auto-placed-subgrid-nested-subgrid-inherited-tracks-003.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>CSS Grid Lanes Test: Nested subgrid inside auto-placed subgrid spanning multiple row tracks</title>
<link rel="author" title="Alison Maher" href="mailto:almaher@microsoft.com">
<link rel="match" href="row-auto-placed-subgrid-inherited-tracks-001-ref.html">
<style>
.wrapper {
width: 100px;
height: 150px;
background: red;
position: relative;
}
.lanes {
display: grid-lanes;
grid-template-rows: 25px 25px 50px 50px;
flow-tolerance: 0;
position: absolute;
top: 0;
left: 0;
}
.child {
grid-row: 1 / span 2;
width: 100px;
height: 50px;
background: green;
}
.subgrid {
display: grid;
grid: subgrid / auto;
grid-row: auto / span 2;
overflow: hidden;
}
.nested-subgrid {
display: grid;
grid: subgrid / auto;
grid-row: 1 / -1;
}
.nested-child {
aspect-ratio: 1;
height: 100%;
grid-row: 1 / -1;
background: green;
}
</style>
</head>
<body>
<p>Test passes if there is a filled green rectangle and <strong>no red</strong>.</p>
<div class="wrapper">
<div class="lanes">
<div class="child"></div>
<div class="subgrid">
<div class="nested-subgrid">
<div class="nested-child"></div>
</div>
</div>
</div>
</div>
</body>
</html>