summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-position-try-012-ref.html
blob: fbc0b5fc6da55cfadb1ea610092882b8ff7502a7 (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
<!DOCTYPE html>
<style>
#scroller {
  width: 400px;
  height: 400px;
  overflow-y: scroll;
}

.box {
  min-height: 100px;
  width: 100px;
}

#anchor {
  background: orange;
}

#anchored {
  width: 100px;
  height: 100px;
  background: green;
}
</style>

<div id="scroller">
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box" id="anchor"></div>
  <div id="anchored"></div>
  <div class="box"></div>
  <div class="box"></div>
  <div class="box"></div>
</div>

<script>
scroller.scrollTop = 150;
</script>