grid-gap-004.html (969B)
1 <!DOCTYPE HTML> 2 <html><head> 3 <meta charset="utf-8"> 4 <title>CSS Grid Test: nested subgrid</title> 5 <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-grid-2"> 7 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 8 <link rel="match" href="grid-gap-004-ref.html"> 9 <style> 10 html,body { 11 color:black; background-color:white; font:24px/1 Ahem; padding:0; margin:0; 12 } 13 14 .grid { 15 display:inline-grid; 16 grid:100px auto/100px auto; 17 gap:20px; 18 border:3px solid; 19 background:yellow; 20 } 21 span { background:cyan; } 22 span:nth-child(2n+1) { background:grey; } 23 </style> 24 </head> 25 <body> 26 27 <div class="grid"> 28 <div style="display:grid; grid:subgrid/subgrid; gap:100px; grid-area:span 2/span 2"> 29 <div style="display:grid; grid:subgrid/100px; gap:100px; grid-row:span 2"> 30 <span>a</span><span>b</span> 31 </div> 32 <span style="grid-area:2/2">c</span> 33 </div> 34 </div> 35 36 </body> 37 </html>