grid-item-containing-block-001.html (1084B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Grid item sizing</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"> 7 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 8 <style> 9 #grid { 10 display: grid; 11 width: 200px; 12 height: 200px; 13 grid-template-rows: 100px; 14 grid-template-columns: 100px; 15 } 16 17 #test-overlapped-red { 18 background-color: red; 19 width: 100%; 20 height: 100%; 21 } 22 23 #test-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 32 <div id="grid"> 33 <div id="test-overlapped-red"> 34 <div id="test-overlapping-green"></div> 35 </div> 36 </div> 37 </body>