summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-position/sticky/reference/position-sticky-left-002-ref.html
blob: 75aa9a4c1f4dc9fd5a13ea4f96f77d44491b598f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CSS Reftest Reference</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">

  <style>
  div.scrolling-container
    {
      height: 150px;
      margin-bottom: 30px;
      overflow-y: hidden;
      position: static;
      white-space: nowrap;
      width: 250px;
    }

  div.horizontal-spacer-200
    {
      display: inline-block;
      height: 100%;
      width: 200px;
    }

  div.sticky
    {
      background-color: green;
      display: inline-block;
      height: 100px;
      position: relative;
      vertical-align: top;
      width: 100px;
    }

  div#first-sticky
    {
      left: 0px;
    }

  div#second-sticky
    {
      left: 50px;
    }

  div#third-sticky
    {
      left: 100px;
    }
  </style>

  <body onload="document.getElementById(&quot;first-scrolling-container&quot;).scrollLeft = 50; document.getElementById(&quot;second-scrolling-container&quot;).scrollLeft = 150; document.getElementById(&quot;third-scrolling-container&quot;).scrollLeft = 300;">

  <p>Test passes if there are 3 filled green squares and <strong>no red</strong>.

  <div id="first-scrolling-container" class="scrolling-container">

    <div class="horizontal-spacer-200"></div><div id="first-sticky" class="sticky"></div><div class="horizontal-spacer-200"></div>

  </div>


  <div id="second-scrolling-container" class="scrolling-container">

    <div class="horizontal-spacer-200"></div><div id="second-sticky" class="sticky"></div><div class="horizontal-spacer-200"></div>

  </div>

  <div id="third-scrolling-container" class="scrolling-container">

    <div class="horizontal-spacer-200"></div><div id="third-sticky" class="sticky"></div><div class="horizontal-spacer-200"></div>

  </div>