CSS <position-area> Data Type
The <position-area> data type places an anchor-positioned element in a 3x3 grid of tiles around its anchor, such as top center or bottom span-right.
Description
The <position-area> CSS data type describes where an anchor-positioned element should be placed relative to its anchor, using a 3×3 grid of tiles. It is the value type of the position-area property, part of CSS anchor positioning. Instead of writing inset values with anchor(), you name the tile (or span of tiles) where the element should go, such as top center or bottom span-right.
Imagine the anchor element sitting in the middle cell of a 3×3 grid that covers the containing block. The rows are top, center and bottom, and the columns are left, center and right. A value usually names one row and one column; top center puts the element directly above the anchor. Keywords starting with span- extend the area across two tiles, for example span-right covers the centre and right columns, and span-all covers a whole row or column. If only one keyword is given, the other axis defaults to span-all.
Logical keywords are also available, such as block-start, inline-end, start and end, which follow the writing mode, and self- versions that use the positioned element's own writing mode. The element is aligned automatically toward the anchor within the chosen area, and position-try-fallbacks can flip it to another area when it would overflow.
Examples:
.button {
anchor-name: --btn;
}
.tooltip {
position: absolute;
position-anchor: --btn;
position-area: top center; /* directly above */
position-try-fallbacks: flip-block; /* below if no room */
}
.menu {
position: absolute;
position-anchor: --btn;
position-area: bottom span-right; /* below, aligned to the left edge */
}
Interactive Demo
Syntax
<position-area> = [ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | self-x-start | self-x-end | span-self-x-start | span-self-x-end | span-all ]
|| [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | self-y-start | self-y-end | span-self-y-start | span-self-y-end | span-all ] ]
| [ block-start | center | block-end | span-block-start | span-block-end | span-all ]
|| [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ]
| [ start | center | end | span-start | span-end | span-all ]{1,2}Values
- top | center | bottomThe row of the 3x3 grid: above the anchor, level with it, or below it.
- left | center | rightThe column of the 3x3 grid: left of the anchor, aligned with it, or right of it.
- span-top | span-bottom | span-left | span-rightSpans two tiles: the centre tile plus the named side, for example span-right covers the centre and right columns.
- span-allSpans all three tiles in that axis. Used by default for an axis that is not specified.
- block-start | block-end | inline-start | inline-endLogical equivalents that follow the writing mode of the containing block.
- start | endLogical keywords that apply to both axes, for example start end.
- self-* keywordsVersions such as self-x-start or self-block-end that use the positioned element's own writing mode.
Example
Browser Support
The following information will show you the current browser support for the CSS position-area data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





