tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

flexbox-item-align-self-dynamic-pos-001.html (1087B)


      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 Flexbox Test: dynamic change .left on abs.pos. item w. align-self:center</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="flexbox-item-align-self-dynamic-pos-001-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 .flexbox {
     17  display: flex;
     18  position: relative;
     19  height: 100px;
     20 }
     21 
     22 #item {
     23  background: grey;
     24  position: absolute;
     25  align-self: center;
     26  left: 10px;
     27 }
     28 
     29 </style>
     30 </head>
     31 <body>
     32 
     33 <div class="flexbox">
     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>