subgrid-baseline-003.html (1033B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Grid Test: baseline-aligned subgrid item</title> 6 <link rel="author" title="Matt Woodrow" href="mailto:mattwoodrow@apple.com"> 7 <link rel="help" href="https://drafts.csswg.org/css-grid-2"> 8 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 9 <link rel="match" href="subgrid-baseline-003-ref.html"> 10 <style> 11 html,body { 12 color:black; background-color:white; font:16px/1 Ahem; padding:0; margin:0; 13 } 14 15 .grid { 16 display: grid; 17 grid-template-columns: auto auto; 18 grid-template-rows: auto auto; 19 max-width: 100px; 20 place-items: baseline start; 21 } 22 23 .subgrid { 24 display: grid; 25 grid-template-rows: subgrid; 26 grid-row: 1 / 3; 27 grid-column: 2; 28 29 padding-bottom: 20px; 30 place-items: inherit; 31 } 32 33 .first { 34 font-size: 3em; 35 grid-row: 2; 36 } 37 38 .second { 39 font-size: 2em; 40 grid-row: 2; 41 } 42 </style> 43 </head> 44 <body> 45 <div class="grid"> 46 <div class="first">A</div> 47 <div class="subgrid"> 48 <div class="second">A</div> 49 </div> 50 </div> 51 52 </body></html>