Pinning a tooltip or dropdown next to its trigger used to all but require a JS library (Popper, Floating UI) that measures getBoundingClientRect() and recalculates on every scroll and resize. CSS anchor positioning gives the trigger an `anchor-name` and lets the positioned element reference it with `position-anchor` and functions like `top: anchor(bottom)`, so the browser computes it during layout.
Paired with `position-try` / `position-try-fallbacks`, collision avoidance — flipping to the other side when it would run off-screen — also happens without JS. It pairs especially well with the popover API and the top layer, so anchoring a native popover to its trigger is an increasingly common combination.
Check caniuse/MDN baseline for support. Browsers without it still need JS-based getBoundingClientRect() positioning — the fallback below is the minimal version of that.
When to use
Building trigger-anchored UI — tooltips, popovers, dropdowns — without a JS positioning library.