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/subgrid/writing-directions-003.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<html><head>
<meta charset="utf-8">
<title>CSS Grid Test: out-of-flow subgridded items properly map repetitions</title>
<link rel="author" title="Kurt Catti-Schmidt" href="mailto:kschmi@microsoft.com">
<link rel="match" href="writing-directions-003-ref.html">
<style>
.grid {
display: grid;
grid-template: repeat(5, 10px) repeat(5, 10px) / repeat(5, 10px) repeat(5, 10px);
width: 100px;
height: 100px;
border: 1px solid;
background: grey;
}
.subgrid {
position: relative;
display: grid;
grid-template: subgrid / subgrid;
grid-column: span 10;
grid-row: span 10;
}
.grid-item {
width: 10px;
height: 10px;
background: orange;
border: 1px solid;
position: absolute;
}
.rtl { direction:rtl; }
.ltr { direction:ltr; }
</style>
</head>
<body>
<div class="grid">
<div class="subgrid rtl">
<div class="grid-item" style="grid-column: 10; grid-row: 10;"></div>
<div class="grid-item" style="grid-column: 9; grid-row: 9;"></div>
<div class="grid-item" style="grid-column: 8; grid-row: 8;"></div>
<div class="grid-item" style="grid-column: 7; grid-row: 7;"></div>
<div class="grid-item" style="grid-column: 6; grid-row: 6;"></div>
<div class="grid-item" style="grid-column: 5; grid-row: 5;"></div>
<div class="grid-item" style="grid-column: 4; grid-row: 4;"></div>
<div class="grid-item" style="grid-column: 3; grid-row: 3;"></div>
<div class="grid-item" style="grid-column: 2; grid-row: 2;"></div>
<div class="grid-item" style="grid-column: 1; grid-row: 1;"></div>
</div>
</div>
<div class="grid rtl">
<div class="subgrid ltr">
<div class="grid-item" style="grid-column: 10; grid-row: 10;"></div>
<div class="grid-item" style="grid-column: 9; grid-row: 9;"></div>
<div class="grid-item" style="grid-column: 8; grid-row: 8;"></div>
<div class="grid-item" style="grid-column: 7; grid-row: 7;"></div>
<div class="grid-item" style="grid-column: 6; grid-row: 6;"></div>
<div class="grid-item" style="grid-column: 5; grid-row: 5;"></div>
<div class="grid-item" style="grid-column: 4; grid-row: 4;"></div>
<div class="grid-item" style="grid-column: 3; grid-row: 3;"></div>
<div class="grid-item" style="grid-column: 2; grid-row: 2;"></div>
<div class="grid-item" style="grid-column: 1; grid-row: 1;"></div>
</div>
</div>
</body>
</html>