summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/anchor-position-top-layer-ref.html
blob: dc7f77f2b3441ebee25f3e40a9480b668ee79ea4 (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>
<title>Tests anchor positioning with top-layer elements</title>

<style>
body {
  margin: 0;
  height: 300vh;
}

#anchor {
  position: fixed;
  top: 200px;
  left: 200px;
  width: 100px;
  height: 100px;
  background: orange;
}

#target {
  position: fixed;
  top: 200px;
  left: 300px;
  width: 100px;
  height: 100px;
  background: lime;
}
</style>

<div id="anchor"></div>
<div id="target"></div>

<script>
document.scrollingElement.scrollTop = 100;
</script>