grid-gap-001.html (1468B)
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 with definite grid-gap in both axes</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-001-ref.html"> 12 <style> 13 html,body { 14 color:black; background-color:white; font:24px/1 monospace; padding:0; margin:0; 15 } 16 17 .wrapper { 18 display: inline-grid; 19 gap: 20px; 20 grid-template-columns: repeat(4,auto); 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 .d { 51 grid-column: 2 / 5; 52 grid-row: 2 / 4; 53 display: grid; 54 row-gap: 100px; 55 column-gap: 10px; 56 grid: subgrid / subgrid; 57 } 58 </style> 59 </head> 60 <body> 61 62 <div class="wrapper"> 63 <div class="box a">A</div> 64 <div class="box b">B</div> 65 <div class="box c">C</div> 66 <div class="box d"> 67 <div class="box e">E</div> 68 <div class="box f">F</div> 69 <div class="box g">G</div> 70 <div class="box h">H</div> 71 <div class="box i">I</div> 72 </div> 73 </div>