grid-abspos-items-005.html (2033B)
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 <link rel="help" href="http://dev.w3.org/csswg/css-grid/#abspos-items"> 11 <link rel="match" href="grid-abspos-items-004-ref.html"> 12 <style type="text/css"> 13 html,body { 14 color:black; background-color:white; font-size:16px; padding:0; margin:0; 15 } 16 separator { clear:both; display:block; height:6px; } 17 18 .grid { 19 display: grid; 20 float: left; 21 position: relative; 22 border-style: solid; 23 border-width: 1px 3px 5px 7px; 24 padding: 1px; 25 border-block-start-color: blue; 26 border-inline-start-color: lime; 27 grid-template: 13px 23px 7px / 11px 31px 13px; 28 margin-right: 4px; 29 inline-size: 65px; 30 } 31 32 abs1,abs2,abs3,abs4 { 33 position: absolute; 34 top:0;left:0;bottom:0;right:0; 35 background: grey; 36 } 37 abs1 { grid-area: 1 / 1 / 2 / 4; } 38 abs2 { grid-area: 1 / 1 / 4 / 2; } 39 abs3 { grid-area: 1 / 3 / 4 / 4; } 40 abs4 { grid-area: 3 / 1 / 4 / 4; } 41 42 .hl { writing-mode: horizontal-tb; direction:ltr; } 43 .hr { writing-mode: horizontal-tb; direction:rtl; } 44 .vl { writing-mode: vertical-lr; } 45 .vr { writing-mode: vertical-rl; } 46 .vlr { writing-mode: vertical-lr; direction:rtl; } 47 .vrl { writing-mode: vertical-rl; direction:ltr; } 48 49 </style> 50 </head> 51 <body> 52 53 <script> 54 var wm = [ "hl", "hr", "vl", "vr", "vlr", "vrl" ]; 55 for (var i = 0; i < wm.length; ++i) { 56 for (var j = 0; j < wm.length; ++j) { 57 var div = document.createElement("div"); 58 div.className = "grid " + wm[i]; 59 div.appendChild(document.createElement("abs1")); 60 div.appendChild(document.createElement("abs2")); 61 div.appendChild(document.createElement("abs3")); 62 div.appendChild(document.createElement("abs4")); 63 document.body.appendChild(div) 64 } 65 document.body.appendChild(document.createElement("separator")); 66 } 67 </script> 68 69 70 </body> 71 </html>