grid-lanes-intrinsic-sizing-rows-004-mix1.html (3063B)
1 <!DOCTYPE HTML> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html> 7 <meta charset="utf-8"> 8 <title>CSS Grid Test: Grid Lanes layout column sizing - max-content</title> 9 <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com"> 10 <link rel="help" href="https://drafts.csswg.org/css-grid-3"> 11 <link rel="match" href="grid-lanes-intrinsic-sizing-rows-004-mix1-ref.html"> 12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 13 <style> 14 15 @import "support/grid-lanes-intrinsic-sizing-visual.css"; 16 17 grid { 18 display: inline-grid-lanes; 19 grid-lanes-direction: row; 20 gap: 1px 2px; 21 grid-template-rows: 1fr 2fr min-content max-content; 22 border: 1px solid; 23 padding: 1px 0 2px 0; 24 vertical-align: top; 25 height: max-content; 26 font-family: Ahem; 27 font-size: 15px; 28 } 29 30 item { 31 /* allow for differing min-content and max-content sizes */ 32 writing-mode: vertical-rl; 33 text-orientation: sideways; 34 } 35 36 grid > item:nth-child(1) { 37 background-color: #89CFF0; 38 } 39 40 grid > item:nth-child(2) { 41 background-color: #FF6F61; 42 } 43 44 grid > item:nth-child(3) { 45 background-color: #FDF3E7; 46 } 47 48 grid > item:nth-child(4) { 49 background-color: #F4C542; 50 } 51 52 grid > item:nth-child(5) { 53 background-color: #333333; 54 } 55 56 grid > item:nth-child(6) { 57 background-color: #B2C8A5; 58 } 59 </style> 60 61 <body> 62 63 <section class="mix1"> 64 <grid title="Wider 1st item 2ch"> 65 <item style="height:2ch">1</item> 66 <item>2 2</item> 67 <item>3 3</item> 68 <item>4</item> 69 <item>5 5</item> 70 </grid> 71 72 <grid title="Wrapped 5th item 2ch"> 73 <item>1</item> 74 <item>2 2</item> 75 <item>3 3</item> 76 <item>4</item> 77 <item style="height:2ch">5 5</item> 78 </grid> 79 80 <grid title="Wrapped 5th item 2ch in col 2"> 81 <item>1</item> 82 <item>2 2</item> 83 <item>3 3</item> 84 <item>4</item> 85 <item style="height:2ch; grid-row:2">5 5</item> 86 </grid> 87 88 <grid title="5th item 4ch in col 2-3"> 89 <item>1</item> 90 <item>2 2</item> 91 <item>3 3</item> 92 <item>4</item> 93 <item style="height:4ch; grid-row:2/span 2">5 5</item> 94 </grid> 95 96 <grid title="5th item in col 2-3, 6th item 5ch in col 1-3"> 97 <item>1</item> 98 <item>2 2</item> 99 <item>3 3</item> 100 <item>4</item> 101 <item style="grid-row:2/span 2">5 5</item> 102 <item style="height:5ch; grid-row:span 3/4">6</item> 103 </grid> 104 105 <grid title="5th item 3ch in col 2-3, 6th item 5ch in col 1-3"> 106 <item>1</item> 107 <item>2 2</item> 108 <item>3 3</item> 109 <item>4</item> 110 <item style="height:3ch; grid-row:span 2/4">5</item> 111 <item style="height:5ch; grid-row:1/span 3">6</item> 112 </grid> 113 114 <grid title="5th item span 4"> 115 <item>1</item> 116 <item>2 2</item> 117 <item>3 3</item> 118 <item>4</item> 119 <item style="grid-row:span 4">5 5</item> 120 </grid> 121 122 <grid title="5th item 6ch span 4"> 123 <item>1</item> 124 <item>2 2</item> 125 <item>3 3</item> 126 <item>4</item> 127 <item style="height:6ch; grid-row:span 4">5 5</item> 128 </grid> 129 130 <grid title="5th item 6ch span 3"> 131 <item>1</item> 132 <item>2 2</item> 133 <item>3 3</item> 134 <item>4</item> 135 <item style="height:6ch; grid-row:span 3">5 5</item> 136 </grid> 137 </section> 138 </body>