grid-item-align-dynamic-pos-002.html (1090B)
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 <title>CSS Grid Test: dynamic change .left on abs.pos. item w. align-self:end</title> 8 <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405319"> 9 <link rel="help" href="https://drafts.csswg.org/css-align-3/#propdef-align-self"> 10 <link rel="match" href="grid-item-align-dynamic-pos-002-ref.html"> 11 <style type="text/css"> 12 html,body { 13 color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0; 14 } 15 16 .grid { 17 display: inline-grid; 18 background: lightgrey; 19 grid: 50px 50px / 50px 50px; 20 } 21 22 #item { 23 background: grey; 24 position: absolute; 25 align-self: end; 26 left: 10px; 27 } 28 29 </style> 30 </head> 31 <body> 32 33 <div class="grid"> 34 <div id="item">X</div> 35 </div> 36 37 <script> 38 document.body.offsetLeft; 39 var items = Array.prototype.slice.call(document.querySelectorAll('#item')); 40 items.map(item => item.style.left = "20px"); 41 document.body.offsetLeft; 42 </script> 43 44 </body> 45 </html>