grid-layout-grid-in-grid.html (1777B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Grid Layout Test: grid in grid</title> 5 <link rel="author" title="Leo Deng" href="mailto:myst.dg@gmail.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-grid/#grid-items"> 7 <link rel="match" href="../reference/grid-layout-grid-in-grid-ref.html"> 8 <meta name="assert" content="the nested grid should behave the same as reference."> 9 <style> 10 body { 11 margin: 0; 12 padding: 0; 13 } 14 #caseTitle { 15 margin: 10px; 16 height: 40px; 17 } 18 #grid { 19 height: 150px; 20 width: 150px; 21 background: #eee; 22 display: grid; 23 grid-template-columns: 50px 100px; 24 grid-template-rows: 100px 50px; 25 } 26 .a { 27 background: blue; 28 grid-column: 1; 29 grid-row: 1; 30 } 31 .b { 32 background: yellow; 33 grid-column: 2; 34 grid-row: 1; 35 display: grid; 36 grid-template-columns: 50px 50px; 37 grid-template-rows: 50px 50px; 38 } 39 .b1 { 40 background: orange; 41 grid-column: 1; 42 grid-row: 1; 43 } 44 .b2 { 45 background: cyan; 46 grid-column: 2; 47 grid-row: 2; 48 } 49 .c { 50 background: pink; 51 grid-column: 2; 52 grid-row: 2; 53 } 54 </style> 55 </head> 56 <body> 57 <p id="caseTitle">The test passes if it has the same visual effect as reference.</p> 58 <div id="grid"> 59 <div class="a"><div style="height:100px;"> </div></div> 60 <div class="b"> 61 <div class="b1"><div style="height:50px;"> </div></div> 62 <div class="b2"><div style="height:50px;"> </div></div> 63 </div> 64 <div class="c"><div style="height:50px;"> </div></div> 65 </div> 66 </body> 67 </html>