position-area

A newer, simplified way to position an element relative to its anchor. Instead of manually calculating top/left, you can use logical regions like 'top-right' or 'bottom-center'.

.floating-menu {
  position: absolute;
  position-anchor: --menu-trigger;
  /* Automatically places the menu at the bottom-center of the anchor */
  position-area: bottom center;
}
Initial value
none
Inherited
No
Applies to
positionedElementsWithADefaultAnchorElement
Animation type
discrete

Values

none
Limited availability 76% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Not ready for production without a fallback.

129+
129+
ESC