summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/position-visibility-no-overflow-scroll-ref.html
blob: b62a6d1078b28c3083e4292b0777e24c13b716e1 (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
<!DOCTYPE html>
<style>
  #scroll-container {
    overflow: hidden scroll;
    width: 400px;
    height: 150px;
  }

  .anchor {
    width: 100px;
    height: 100px;
    background: orange;
    display: inline-block;
  }

  .target {
    width: 100px;
    height: 100px;
  }
</style>

<div id="scroll-container">
  <div class="anchor">anchor1</div>
  <div class="anchor" style="position: relative; top: 100px">anchor2</div>
  <div id="target1" class="target" style="background: green">target1</div>
  <div style="height: 200px"></div>
</div>
<script>
document.getElementById('scroll-container').scrollTop = 50;
</script>