This note has an interactive demo. Try it in the original
A tooltip that sticks to its button and jumps to the other side when it hits an edge used to mean a positioning library. Now it takes a handful of CSS lines, and the core of it has been Baseline since January 2026.
Drag the orb in the demo above toward the top edge. The card that was sitting above it jumps below. Push it to a side with left selected and it moves to the right. The two dashed guides and the small --orb label follow along too. The only thing the JavaScript does is move the orb. Where everything else goes is decided by CSS.
What it is
CSS anchor positioning lets you place an absolutely or fixed positioned element relative to another element, the anchor , instead of relative to its containing block. That's the problem behind every tooltip, dropdown, popover menu and "new" badge.…