tor-browser

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

position-sticky-top-and-bottom-003.html (2724B)


      1 <!DOCTYPE html>
      2 
      3  <meta charset="UTF-8">
      4 
      5  <title>CSS Position Test: sticky element with top and bottom offsets specified with percentage unit</title>
      6 
      7  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
      8  <link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos">
      9  <link rel="match" href="reference/position-sticky-top-and-bottom-003-ref.html">
     10 
     11  <meta name="flags" content="">
     12 
     13  <style>
     14  div.scrolling-container
     15    {
     16      background-image: url("support/100x100-red.png");
     17      background-repeat: no-repeat;
     18      display: inline-block;
     19      height: 250px;
     20      margin-right: 30px;
     21      overflow: auto;
     22      position: static;
     23      width: 150px;
     24    }
     25 
     26  div#first-scrolling-container
     27    {
     28      background-position: left 125px;
     29    }
     30 
     31  div#second-scrolling-container
     32    {
     33      background-position: left 50px;
     34    }
     35 
     36  div#third-scrolling-container
     37    {
     38      background-position: left 25px;
     39    }
     40 
     41  div.vertical-spacer
     42    {
     43      height: 200px;
     44    }
     45 
     46  div.sticky
     47    {
     48      background-color: green;
     49      bottom: 10%;
     50      height: 100px;
     51      position: sticky;
     52      top: 10%;
     53      width: 100px;
     54    }
     55  </style>
     56 
     57  <body onload="document.getElementById(&quot;first-scrolling-container&quot;).scrollTop = 50; document.getElementById(&quot;second-scrolling-container&quot;).scrollTop = 150; document.getElementById(&quot;third-scrolling-container&quot;).scrollTop = 250;">
     58 
     59  <p>Test passes if there are 3 filled green squares and <strong>no red</strong>.
     60 
     61  <!--
     62  first-scrolling-container: when reaching the first (top) sticking point
     63  -->
     64 
     65  <div id="first-scrolling-container" class="scrolling-container">  <!-- 150w x 250h viewport -->
     66 
     67    <div class="vertical-spacer"></div> <!-- 150w x 200h -->
     68 
     69    <div id="first-sticky" class="sticky"></div> <!-- 100w x 100h -->
     70 
     71    <div class="vertical-spacer"></div> <!-- 150w x 200h -->
     72 
     73  </div>
     74 
     75  <!--
     76  second-scrolling-container: between both sticking points
     77  -->
     78 
     79  <div id="second-scrolling-container" class="scrolling-container">  <!-- 150w x 250h viewport -->
     80 
     81    <div class="vertical-spacer"></div> <!-- 150w x 200h -->
     82 
     83    <div id="second-sticky" class="sticky"></div> <!-- 100w x 100h -->
     84 
     85    <div class="vertical-spacer"></div> <!-- 150w x 200h -->
     86 
     87  </div>
     88 
     89  <!--
     90  third-scrolling-container: when reaching the second (bottom) sticking point
     91  -->
     92 
     93 
     94  <div id="third-scrolling-container" class="scrolling-container">  <!-- 150w x 250h viewport -->
     95 
     96    <div class="vertical-spacer"></div> <!-- 150w x 200h -->
     97 
     98    <div id="third-sticky" class="sticky"></div> <!-- 100w x 100h -->
     99 
    100    <div class="vertical-spacer"></div> <!-- 150w x 200h -->
    101 
    102  </div>