grid-gap-larger-001.html (1665B)
1 <!DOCTYPE HTML> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html><head> 7 <meta charset="utf-8"> 8 <title>CSS Grid Test: subgrid grid-gap:20px</title> 9 <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> 10 <link rel="help" href="https://drafts.csswg.org/css-grid-2"> 11 <link rel="match" href="grid-gap-larger-001-ref.html"> 12 <style> 13 html,body { 14 color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0; 15 } 16 17 .wrapper { 18 display: grid; 19 gap: 0; 20 grid-template-columns: 150px 100px 150px 100px; 21 grid-template-rows: repeat(3,auto); 22 background-color: #fff; 23 color: #444; 24 } 25 26 .box { 27 background-color: #444; 28 color: #fff; 29 padding: 20px; 30 } 31 32 .box .box { 33 background-color: #ccc; 34 color: #444; 35 } 36 37 .a { 38 grid-column: 1 / 3; 39 } 40 41 .b { 42 grid-column: 4 ; 43 } 44 45 .c { 46 grid-column: 1; 47 grid-row: 2 / 4; 48 } 49 50 .box .f { background-color: purple; } 51 .box .i { background-color: blue; } 52 .box .e { background-color: yellow; } 53 .a { background-color: grey; } 54 .c { background-color: black; } 55 .b { background-color: black; } 56 57 .d { 58 grid-column: 2 / 5; 59 grid-row: 2 / 4; 60 display: grid; 61 gap: 20px; 62 grid: subgrid / subgrid; 63 } 64 65 </style> 66 </head> 67 <body> 68 69 <div class="wrapper"> 70 <div class="box a">A</div> 71 <div class="box b">B</div> 72 <div class="box c">C</div> 73 <div class="box d"> 74 <div class="box e">E</div> 75 <div class="box f">F</div> 76 <div class="box g">G</div> 77 <div class="box h">H</div> 78 <div class="box i">I</div> 79 </div> 80 </div> 81 82 </body> 83 </html>