grid-self-alignment-baseline-with-grid-002.html (1675B)
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 align a display:block item with a display:grid item with spanned 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/#grid-baselines"> 11 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 12 <link rel="match" href="grid-self-alignment-baseline-with-grid-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 .inner-grid { 28 display: grid; 29 grid: auto auto / auto; 30 background: lightgrey; 31 grid-column: 2; 32 grid-row: 3; 33 min-width: 10px; 34 min-height: 0; 35 border: 0 solid lightblue; 36 border-top-width: 10px; 37 border-bottom-width: 40px; 38 place-content: inherit; 39 place-items: inherit; 40 padding-bottom: 20px; 41 } 42 43 x { 44 min-width: 40px; 45 min-height: 10px; 46 font-size: 10em; 47 background: silver; 48 } 49 50 </style> 51 </head> 52 <body> 53 54 <div class="grid"> 55 <y style="grid-area:3/1">A </y> 56 <div class="inner-grid"> 57 <x style="grid-row:1/span 3"> A</x><x style="grid-column:1"></x> 58 </div> 59 </div> 60 61 <div class="grid" style="align-items:last baseline"> 62 <y style="grid-area:3/1">A </y> 63 <div class="inner-grid"> 64 <x></x><x style="grid-row:2/span 3"> A</x> 65 </div> 66 </div> 67 68 </body> 69 </html>