positioned-grid-items-021.html (959B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Positioned grid items</title> 4 <link rel="help" href="https://drafts.csswg.org/css-grid-2/#abspos"> 5 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 6 <meta name="assert" content="Checks that absolutely positioned items are properly placed and sized."> 7 <style> 8 #grid { 9 display: grid; 10 width: 100px; 11 height: 100px; 12 position: relative; 13 } 14 15 .absolute { 16 position: absolute; 17 width: 100%; 18 height: 100%; 19 grid-row: 1 / 2; 20 background-color: green; 21 } 22 23 #item { 24 grid-column: 1 / span 3; 25 background-color: red; 26 } 27 </style> 28 29 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 30 31 <div id="grid"> 32 <div class="absolute" style="grid-column: 1 / 2"></div> 33 <div class="absolute" style="grid-column: 2 / 3"></div> 34 <div class="absolute" style="grid-column: 3 / 4"></div> 35 <div id="item"></div> 36 </div>