Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<title>Tests that 'anchor-center' behaves as 'center' when no anchor in containing block</title>
<link rel="match" href="no-anchor-anchor-center-ref.html">
<style>
.anchor {
anchor-name: --dropdownAnchor;
background: orange;
width: 100px;
background-color: orange;
}
.container {
position: fixed;
top: 20px;
left: 50px;
width: 300px;
height: 200px;
background: green;
}
.target {
position-anchor: --dropdownAnchor;
display: flow;
left: 10px;
right: 10px;
position: absolute;
justify-self: anchor-center;
width: 80px;
border: 1px #000 solid;
background: lime;
}
</style>
<div class="anchor">anchor</div>
<div class="container">
<div class="target">target 1</div>
</div>