Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-anchor-position/chrome-365594098-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<style>
#container {
position: relative;
width: 100px;
height: 100px;
}
#anchor {
position: absolute;
anchor-name: --a;
left: 0;
top: 0;
width: 10px;
height: 10px;
background: cornflowerblue;
}
#target {
position: absolute;
position-anchor: --a;
left: 0;
top: anchor(bottom);
width: 10px;
height: 80px;
background: lime;
position-try-fallbacks: --fallback;
}
@position-try --fallback {
left: anchor(right);
top: 0;
width: 10px;
height: 10%;
}
</style>
<div id="container">
<div id="anchor"></div>
<div id="target"></div>
</div>
<script>
document.body.offsetTop;
document.getElementById('container').style.height = '20px';
</script>