orthogonal-writing-mode-002.html (2523B)
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: subgrids with different writing-mode than parent</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="orthogonal-writing-mode-002-ref.html"> 13 <style> 14 html,body { 15 color:black; background-color:white; font:12px/1 Ahem; 16 } 17 18 .grid { 19 display: grid; 20 grid: repeat(4, auto) / repeat(5, auto); 21 place-content: start; 22 border: 1px solid; 23 } 24 25 .subgrid { 26 display: grid; 27 grid: subgrid / auto; 28 grid-column: 2 / span 5; 29 grid-row: 2 / span 5; 30 min-width:10px; 31 min-height:0; 32 border: 0 solid lightblue; 33 border-bottom-width: 40px; 34 background: yellow; 35 padding: 1px 3px 5px 7px; 36 margin: 3px 11px 7px 5px; 37 } 38 39 .vlr { 40 writing-mode: vertical-lr; 41 grid: auto / subgrid; 42 grid-column: 2 / span 5; 43 grid-row: 3 / span 5; 44 background: blue; 45 } 46 47 x { 48 min-width:10px; 49 min-height:0px; 50 } 51 52 x:nth-child(2n+1) { background: silver; } 53 x:nth-child(2n+2) { background: grey; } 54 x:nth-child(2n+3) { background: pink; } 55 x:nth-child(2n+4) { background: black; } 56 57 .hl { writing-mode: horizontal-tb; direction:ltr; } 58 .hr { writing-mode: horizontal-tb; direction:rtl; } 59 .vl { writing-mode: vertical-lr; } 60 .vr { writing-mode: vertical-rl; } 61 .vlr { writing-mode: vertical-lr; direction:rtl; } 62 .vrl { writing-mode: vertical-rl; direction:ltr; } 63 64 </style> 65 </head> 66 <body> 67 68 <div class="grid vrl"> 69 <x style="grid-column:1"></x><x style="grid-column:2"></x><x style="grid-column:3"></x><x style="grid-column:4"></x><x style="grid-column:5"></x><x style="grid-column:6"></x> 70 <div class="subgrid hl"> 71 <x style="grid-column:span 12">A _B</x> 72 <x style="width:100px; height:30px"></x> 73 <x style="background:yellow">C D_</x> 74 </div> 75 </div> 76 77 <div class="grid"> 78 <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> 79 <div class="subgrid vlr"> 80 <x>A _B</x> 81 <x style="width:100px; height:30px"></x> 82 <x>C D_</x> 83 </div> 84 </div> 85 86 <div class="grid"> 87 <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> 88 <div class="subgrid vlr"></div> 89 </div> 90 91 </body> 92 </html>