grid-item-align-002-ref.html (3820B)
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>Reference: align-self (part 2 of 2)</title> 9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151213"> 10 <style type="text/css"> 11 html,body { 12 color:black; background-color:white; font-size:16px; padding:0; margin:0; 13 } 14 separator { clear:both; display:block; height:6px; } 15 16 .grid { 17 display: block; 18 float: left; 19 position: relative; 20 border: 1px solid; 21 /* border-block-start: 2px solid blue; */ 22 border-block-start: 2px solid black; 23 inline-size: 36px; 24 block-size: 25px; 25 margin-right: 4px; 26 background: lightgrey; 27 } 28 wrap { 29 display: block; 30 position: relative; 31 inset-inline-start:1px; 32 background: white; 33 block-size:20px; 34 inline-size:32px; 35 border-block-start: 3px solid lightgrey; 36 } 37 38 span { 39 display: block; 40 width: 13px; 41 height: 9px; 42 background: grey; 43 border-block-start: 2px solid blue; 44 border-inline-start: 2px solid lime; 45 margin: 1px 1px 2px 2px; 46 justify-self: start; 47 } 48 49 abs1,abs2,abs3,abs4 { 50 position: absolute; 51 top:0;left:0;bottom:0;right:0; 52 background: lightgrey;display:none; 53 } 54 abs1 { grid-area: 1 / 1 / 2 / 4; } 55 abs2 { grid-area: 1 / 1 / 4 / 2; } 56 abs3 { grid-area: 1 / 3 / 4 / 4; } 57 abs4 { grid-area: 3 / 1 / 4 / 4; } 58 59 .hl { writing-mode: horizontal-tb; direction:ltr; } 60 .hr { writing-mode: horizontal-tb; direction:rtl; } 61 .vl { writing-mode: vertical-lr; } 62 .vr { writing-mode: vertical-rl; } 63 .vlr { writing-mode: vertical-lr; direction:rtl; } 64 .vrl { writing-mode: vertical-rl; direction:ltr; } 65 66 .astart { align-self:start; } 67 .aend { align-self:end; } 68 .aflexstart { align-self:flex-start; } 69 .aflexend { align-self:flex-end; } 70 .aselfstart { align-self:self-start; } 71 .aselfend { align-self:self-end; } 72 .acenter { margin-right:2px; } 73 .aleft { align-self:left; } 74 .aright { align-self:right; } 75 .astretch1 { align-self:stretch; } 76 .astretch2 { align-self:stretch; width:13px; height:0; } 77 .astretch3 { align-self:stretch; height:0; } 78 .astretch4 { align-self:stretch; width:auto; } 79 .astretch5 { align-self:stretch; width:auto; max-width:13px; } 80 .astretch6 { align-self:stretch; height:0; max-height:9px; } 81 .astretch7 { align-self:stretch; width:auto; height:0; max-width:13px; max-height:9px; } 82 .aauto { align-self:auto; } 83 84 .vr .aend, .vr .aflexend { margin-right:3px; } 85 .vlr .aend, .vlr .aflexend { margin-left:4px; } 86 .vlr .acenter { margin-left:3px; } 87 .vrl .aend, .vrl .aflexend { margin-right:3px; } 88 89 .astretch6 { width:13px; } 90 .astretch5 { width:14px; } 91 .astretch4, .astretch7 { width:15px; } 92 93 </style> 94 </head> 95 <body> 96 97 <script> 98 var gridwm = [ "vr", "vlr", "vrl" ]; // grid-item-align-001.html tests hl/hr/vl 99 var wm = [ "hl", "hr", "vl", "vr", "vlr", "vrl" ]; 100 var test = [ "start", "end", "flexstart", "flexend", "center", "left", "right", 101 "stretch1", "stretch2", "stretch3", "stretch4", "stretch5", 102 "stretch6", "stretch7", "auto" ]; 103 for (var i = 0; i < gridwm.length; ++i) { 104 for (var j = 0; j < wm.length; ++j) { 105 for (var k = 0; k < test.length; ++k) { 106 var div = document.createElement("div"); 107 div.className = "grid " + gridwm[i]; 108 var wrap = document.createElement("wrap"); 109 div.appendChild(wrap); 110 var span = document.createElement("span"); 111 span.className = wm[j] + " a" + test[k]; 112 wrap.appendChild(span); 113 div.appendChild(document.createElement("abs1")); 114 div.appendChild(document.createElement("abs2")); 115 div.appendChild(document.createElement("abs3")); 116 div.appendChild(document.createElement("abs4")); 117 118 document.body.appendChild(div) 119 } 120 document.body.appendChild(document.createElement("separator")); 121 } 122 } 123 </script> 124 125 126 </body> 127 </html>