baseline-001.html (1467B)
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: baseline-aligned subgrid item</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="stylesheet" type="text/css" href="/fonts/ahem.css"> 12 <link rel="match" href="baseline-001-ref.html"> 13 <style> 14 html,body { 15 color:black; background-color:white; font:16px/1 Ahem; padding:0; margin:0; 16 } 17 18 .grid { 19 display: grid; 20 grid: 20px repeat(4, auto) 30px / 30px repeat(4, auto) 20px; 21 place-content: start; 22 place-items: baseline start; 23 border: 1px solid; 24 text-decoration: underline blue; 25 } 26 27 .subgrid { 28 display: grid; 29 grid: subgrid / auto; 30 background: lightgrey; 31 grid-column: 2 / span 4; 32 grid-row: 3 / span 2; 33 min-width: 10px; 34 min-height: 0; 35 background: yellow; 36 place-content: inherit; 37 place-items: inherit; 38 } 39 40 x { 41 min-width: 20px; 42 min-height: 10px; 43 font-size: 8em; 44 background: silver; 45 } 46 47 </style> 48 </head> 49 <body> 50 51 <div class="grid"> 52 <y style="grid-area:4/1">A </y> 53 <div class="subgrid"> 54 <x style="grid-row:2"> A</x><x></x> 55 </div> 56 </div> 57 58 <div class="grid" style="align-items: last baseline"> 59 <y style="grid-area:4/1">A </y> 60 <div class="subgrid"> 61 <x></x><x style="grid-row:2"> A</x> 62 </div> 63 </div> 64 65 </body> 66 </html>