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-lanes-subgridded-to-grid-lanes/column/grid-lanes-subgrid-003a.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Lanes Test: column-axis grid-lanes subgrid inherits parent line names</title>
<link rel="author" title="Yanling Wang" href="mailto:yanlingwang@microsoft.com">
<link rel="match" href="grid-lanes-subgrid-003a-ref.html">
<meta name="assert" content="An explicitly placed grid-lanes subgrid inherits its parent's column line names and resolves them relative to its own grid area.">
<style>
html,body {
color:black; background-color:white; font:32px/1 monospace; padding:0; margin:0;
}
grid-lanes {
display: inline grid-lanes;
grid-template-columns: 100px [subgrid-start] 160px [middle] 80px [subgrid-end];
gap: 4px;
padding: 1px 3px 5px 7px;
border: solid;
border-width: 3px 5px 1px 1px;
background: lightgrey content-box;
}
item {
background: grey;
height: 3ch;
position: relative;
}
item:nth-child(2n) { background:purple; }
item:nth-child(1) {
border: solid;
border-width: 3px 13px 1px 1px;
margin: 7px 1px 5px 3px;
}
subgrid {
display: grid-lanes;
grid-template-columns: subgrid;
grid-column: 2 / span 2;
gap: 4px;
background: yellow;
}
</style>
</head>
<body>
<grid-lanes>
<item>1</item>
<item>2</item>
<item>3</item>
<subgrid>
<item style="grid-column: middle / subgrid-end;">4a</item>
<item style="grid-column: subgrid-start / middle; margin-bottom: 15px;">4b</item>
</subgrid>
</grid-lanes>
</body>
</html>