- Open
data:text/html;charset=UTF-8, <style>
.anchor { anchor-name: --foo; width: 100px; height: 50px; display: block; margin: 30px auto;}
.anchored{position: absolute; left: anchor(--foo 50%); top: anchor(--foo bottom);
justify-self: anchor-center; background: green; padding: .5em 2em;}</style>
<button class="anchor">anchor</button>
<div class="anchored">anchored</div>
- The green element is not horizontally centered with respect to the button.
We must add position-anchor: --foo for anchor-center to take effect. This is often confusing to the user because <anchor-element> is already defined on the left.
Can we change the status quo?