Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/anchor-position-top-layer-007.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<style>
#container {
position: fixed;
inset: 0;
}
#anchor {
position: fixed;
top: 100px;
left: 100px;
width: 50px;
height: 80px;
anchor-name: --anchor;
}
#target {
position: fixed;
inset: auto;
top: anchor(--anchor top);
left: anchor(--anchor right);
margin: 0;
}
</style>
<body onload="checkLayout('#target')">
<div id="container">
<div id="anchor"></div>
<dialog id="target" data-offset-x=150 data-offset-y=100></dialog>
</div>
<script>
document.getElementById('target').showModal();
</script>