summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-scroll-snap/snap-after-relayout/multiple-aligned-targets/positioned-target-iframe.html
blob: 65195af621adc4fb9ce78387c01247c322f89da8 (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
<!DOCTYPE html>
<html>
<body>
  <style>
    .target {
      width: 100px;
      height: 100px;
      background-color: green;
      scroll-snap-align: start;
    }
    .placeholder {
      background-color: purple;
    }
    .snapcontainer {
      border:solid 1px black;
      overflow: scroll;
      scroll-snap-type: y mandatory;
    }
    .big {
      height: 315px;
      width: 600px;
      position: relative;
    }
    .small {
      height: 115px;
      width: 120px;
    }
    .positioned {
      position: absolute;
    }
    #target1, #target2, #target3, #target4, #target5 {
      top: 400px;
    }
    #target1 {
      left: 0px;
    }
    #target2 {
      left: 110px;
    }
    #target3 {
      left: 220px;
    }
    #target4 {
      left: 330px;
    }
    #target5 {
      left: 440px;
    }
    :target {
      background-color: yellow;
    }
    .large-space {
      position: absolute;
      height: 300vh;
      width: 300vw;
    }
  </style>
  <div id="outer" class="big snapcontainer">
    <div id="outerplaceholder1" class="placeholder target"></div>
    <div id="outerplaceholder2" class="placeholder target"></div>
    <div id="inner" class="small snapcontainer">
      <div id="innerplaceholder1" class="placeholder target"></div>
      <div id="innerplaceholder2" class="placeholder target"></div>
      <div id="target1" class="positioned target"><h1>Box 1</h1></div>
      <div id="target2" class="positioned target"><h1>Box 2</h1></div>
      <div id="target3" class="positioned target"><h1>Box 3</h1></div>
      <div id="target4" class="positioned target"><h1>Box 4</h1></div>
      <div id="target5" class="positioned target"><h1>Box 5</h1></div>
    </div>
    <div class="large-space"></div>
  </div>
</body>
</html>