subgrid-baseline-004.html (1087B)
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-004-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: 50px 50px; 18 grid-template-rows: auto auto; 19 place-items: baseline start; 20 } 21 22 .subgrid { 23 display: grid; 24 grid-template-columns: subgrid; 25 grid-row: 1 / 3; 26 grid-column: 2; 27 28 padding-bottom: 20px; 29 writing-mode: vertical-lr; 30 place-items: start baseline; 31 } 32 33 .first { 34 font-size: 3em; 35 grid-row: 2; 36 } 37 38 .second { 39 font-size: 2em; 40 grid-column: 2; 41 writing-mode: horizontal-tb; 42 } 43 </style> 44 </head> 45 <body> 46 <div class="grid"> 47 <div class="first">A</div> 48 <div class="subgrid"> 49 <div class="second">A</div> 50 </div> 51 </div> 52 53 </body> 54 </html>