Favorites

CSS position-area Property

position-area
CSS PropertyThis property is supported by all modern browsers.
Updated 22nd November 2026

The position-area property places an anchor-positioned element in a 3x3 grid around its anchor, such as top center or bottom span-right.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The position-area property places an anchor-positioned element in one of the cells of an imaginary 3×3 grid built around its anchor. The middle cell is the anchor itself and the outer rows and columns extend to the edges of the containing block. Instead of writing top: anchor(bottom); left: anchor(center), you can write position-area: bottom.

A value names a row and a column, using physical keywords (top, bottom, left, right, center), logical keywords (block-start, inline-end, start, end) or the span-* keywords that cover two cells, for example top span-right or bottom span-all. One keyword sets one axis and the other axis defaults to spanning all cells or to center.

The positioned element is laid out inside the chosen area, and its default alignment changes to sit against the anchor, so no extra offsets are needed. It needs a default anchor, set with position-anchor or an implicit anchor, and only affects absolutely or fixed positioned elements. Combine it with position-try-fallbacks to flip to another area when there is not enough room.

Definition

Initial value
none
Applies to
positioned elements with a default anchor box
Inherited
no
Computed value
the keyword none or a pair of keywords
Animatable
discrete
JavaScript syntax
object.style.positionArea

Interactive Demo

Anchor
Tooltip
Demo Code
HTML Code
<div class="demo-area">
	<div class="demo-anchor demo-c">Anchor</div>
	<div class="demo-element">Tooltip</div>
</div>
CSS Code
.demo-area {
	position: relative;
	width: 300px;
	height: 190px;
	background: #f4f4f4;
	outline: 1px dashed #b0b0b0;
}
.demo-anchor {
	position: absolute;
	padding: 8px 12px;
	background: #e7ecff;
	border: 2px solid #4361ee;
	font-size: 14px;
}
.demo-c {
	left: 105px;
	top: 75px;
	anchor-name: --demo-c;
}
.demo-element {
	position: absolute;
	margin: 4px;
	padding: 4px 8px;
	background: #f72585;
	color: #fff;
	font-size: 13px;
	white-space: nowrap;
	position-anchor: --demo-c;
	position-area: top;
}

Syntax

position-area: none | [ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | self-x-start | 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-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

  • noneThe default. No position area is used.
  • top, bottom, left, right, centerPhysical rows and columns of the grid around the anchor. top is the row above the anchor, center the row or column of the anchor itself.
  • span-top, span-bottom, span-left, span-rightCovers the center cell plus the named neighbouring cell, so the element can overlap the anchor and extend to one side.
  • span-allCovers all three cells of that axis.
  • block-start, block-end, inline-start, inline-end, start, endLogical equivalents that follow the writing mode.
  • self-x-start, self-y-end ...Logical keywords resolved against the positioned element's own writing mode.
  • initialSets the property to its initial value.
  • inheritTakes the computed value of the parent element.

Example

<div class="stage">
<button class="anchor">Anchor</button>
<div class="tip">Positioned against the button</div>
</div>
.stage {
  height: 200px;
  font-family: system-ui, sans-serif;
}

.anchor {
  anchor-name: --btn;
  margin: 70px 0 0 120px;
  padding: 10px 18px;
  font: inherit;
}

.tip {
  position: absolute;
  position-anchor: --btn;
  position-area: top span-right;   /* above, extending to the right */
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #f72585;
  color: #fff;
  border-radius: 6px;
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS position-area property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee