summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/reference/anchor-scroll-update-006-ref.html
blob: c7fbb57e762efeb16fa4b9cdd120fb8c2ca79073 (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
<!DOCTYPE html>
<style>
  #cb {
    position: absolute;
    inset: 0;
  }
  #scroller {
    margin-top: 300px;
    overflow-y: scroll;
    height: 100px;
  }
  #spacer { height: 300px; }
  #anchor { anchor-name: --a; }
  #anchored {
    position: absolute;
    width: 100px;
    height: 100px;
    background-color: green;
    top: 100px;
    left: 0;
  }
</style>
<div id="cb">
  <div id="scroller">
    <div id="anchor"></div>
    <div id="spacer"></div>
  </div>
  <div id="anchored"></div>
</div>
<script>
const scroller = document.getElementById('scroller');
scroller.scrollTop = 200;
</script>