dynamic-subgridded-item-height.html (959B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Test: Subgridded item changing its height dynamically</title> 4 <link rel="author" title="Ethan Jimenez" href="mailto:ethavar@microsoft.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid-2/#algo-overview"> 6 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 7 <style> 8 .wrapper { 9 background: red; 10 height: 100px; 11 width: 100px; 12 } 13 .grid { 14 display: grid; 15 grid-template-columns: 100px; 16 } 17 .subgrid { 18 display: grid; 19 grid-template-columns: subgrid; 20 overflow: clip; 21 } 22 .container { background: green } 23 </style> 24 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 25 <div class="wrapper"> 26 <div class="grid"> 27 <div class="subgrid"> 28 <div class="container"> 29 <div id="inner"></div> 30 </div> 31 </div> 32 </div> 33 </div> 34 <script> 35 document.body.offsetHeight; 36 document.getElementById('inner').style.height = '100px'; 37 </script>