grid-gap-002-ref.html (1408B)
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 border-bottom</title> 9 <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 11 <style> 12 html,body { 13 color:black; background-color:white; font:24px/1 Ahem; padding:0; margin:0; 14 } 15 16 .grid { 17 display: grid; 18 grid: repeat(4, auto) / repeat(5, auto); 19 place-content: start; 20 border: 1px solid; 21 } 22 23 .subgrid { 24 display: grid; 25 grid: subgrid / auto; 26 gap: 10px 20px; 27 background: lightgrey; 28 grid-column: 2 / span 5; 29 grid-row: 2 / span 5; 30 min-width:10px; 31 min-height:0; 32 background: yellow; 33 } 34 35 .subgrid > * { background: lightgrey; } 36 37 x { 38 min-width:10px; 39 min-height:0px; 40 } 41 x:nth-child(2n+1) { background: silver; } 42 x:nth-child(2n+2) { background: magenta; } 43 x:nth-child(2n+3) { background: pink; } 44 x:nth-child(2n+4) { background: grey; } 45 46 e { 47 border: 0 solid lightblue; 48 border-bottom-width: 40px; 49 margin: -5px 0; 50 } 51 </style> 52 </head> 53 <body> 54 55 <div class="grid"> 56 <x style="grid-row:1"></x><x style="grid-row:2"></x><x style="grid-row:3"></x><x style="grid-row:4"></x><x style="grid-row:5"></x><x style="grid-row:6"></x> 57 <div class="subgrid"> 58 <c>c</c> 59 <d>d</d> 60 <e></e> 61 </div> 62 </div> 63 64 </body> 65 </html>