grid-abspos-items-005-ref.html (2100B)
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: abs pos areas</title> 9 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1204585"> 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-style: solid; 21 border-width: 1px 3px 5px 7px; 22 padding: 1px; 23 border-block-start-color: blue; 24 border-inline-start-color: lime; 25 grid-template: 11px 31px 13px / 13px 23px 7px; 26 margin-right: 4px; 27 inline-size: 65px; 28 block-size: 43px; 29 } 30 31 abs1,abs2 { 32 position: absolute; 33 top:0;left:0;bottom:0;right:0; 34 background: grey; 35 margin:1px; 36 margin-inline-end:11px; 37 } 38 39 abs2 { background:white; } 40 .hl abs2 { top:13px;left:11px; height:23px; width:31px; } 41 .hr abs2 { top:13px;right:11px; height:23px; width:31px; } 42 .vl abs2 { top:11px;left:13px; height:31px; width:23px; } 43 .vr abs2 { top:11px;right:13px; height:31px; width:23px; } 44 .vlr abs2 { bottom:11px;left:13px; height:31px; width:23px; } 45 .vrl abs2 { top:11px;right:13px; height:31px; width:23px; } 46 47 .hl { writing-mode: horizontal-tb; direction:ltr; } 48 .hr { writing-mode: horizontal-tb; direction:rtl; } 49 .vl { writing-mode: vertical-lr; } 50 .vr { writing-mode: vertical-rl; } 51 .vlr { writing-mode: vertical-lr; direction:rtl; } 52 .vrl { writing-mode: vertical-rl; direction:ltr; } 53 54 </style> 55 </head> 56 <body> 57 58 <script> 59 var wm = [ "hl", "hr", "vl", "vr", "vlr", "vrl" ]; 60 for (var i = 0; i < wm.length; ++i) { 61 for (var j = 0; j < wm.length; ++j) { 62 var div = document.createElement("div"); 63 div.className = "grid " + wm[i]; 64 div.appendChild(document.createElement("abs1")); 65 div.appendChild(document.createElement("abs2")); 66 document.body.appendChild(div) 67 } 68 document.body.appendChild(document.createElement("separator")); 69 } 70 </script> 71 72 73 </body> 74 </html>