summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/anchor-position-inline-002.html
blob: d723e0c00440b69007463ddfe84bf83c2bdb07b0 (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
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#propdef-anchor-name">
<link rel="author" href="mailto:kojii@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script src="support/test-common.js"></script>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
#container {
  position: relative;
  font-family: Ahem;
  font-size: 10px;
  line-height: 1;
  width: 10em;
}
#anchor1 {
  anchor-name: --a1;
}
.target {
  position: absolute;
}
</style>
<body onload="checkLayoutForAnchorPos('.target')">
  <div id="container">
    <div>spacer</div>
    <div>
      <br>
      <!-- The following line wraps between "5" and "7". -->
      0123<span id="anchor1">45 789</span>000
    </div>

    <div class="target" style="left: anchor(--a1 left)" data-offset-x=0></div>
    <div class="target" style="right: anchor(--a1 right)" data-offset-x=60></div>
    <div class="target" style="top: anchor(--a1 top)" data-offset-y=20></div>
    <div class="target" style="bottom: anchor(--a1 bottom)" data-offset-y=40></div>
  </div>
</body>