grid-item-containing-block-004.html (1209B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Grid item sizing in a positioned grid container</title> 4 <link rel="author" title="Tomek Wytrebowicz" href="mailto:tomalecpub@gmail.com"> 5 <link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-items" title="4. Grid Items"> 6 <meta name="assert" content="A grid item is sized within the containing block defined by its grid area that intersects flexible tracks"> 7 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 8 <style> 9 #grid { 10 display: grid; 11 position: absolute; 12 height: 200px; 13 width: 200px; 14 grid-template-rows: 1fr 1fr; 15 grid-template-columns: 1fr 1fr; 16 } 17 18 #test-item-overlapped-red { 19 background-color: red; 20 width: 100%; 21 height: 100%; 22 } 23 #reference-overlapping-green{ 24 background-color: green; 25 width: 100px; 26 height: 100px; 27 } 28 </style> 29 <body> 30 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 31 <div id="grid"> 32 <div id="test-item-overlapped-red"> 33 <div id="reference-overlapping-green"> 34 </div> 35 </div> 36 </div> 37 </body>