Anchor positioning
Anchor positioning places an element relative to another one, its anchor, without JavaScript. It is the basis for tooltips, dropdown menus and popovers.
- anchor-name: gives a name, starting with two dashes, to the element that acts as the anchor.
- position-anchor: sets which anchor an element with position: absolute or fixed uses.
- position-area: places the element in an area around the anchor, such as top, bottom or right.
- position-try-fallbacks: defines alternative positions for when the element does not fit.
Example
The element with the tooltip class is anchored to the element with the anchor class. Change position-area to move it around.
ResultLive
html
css