Favorites

CSS <position-area> Data Type

<position-area>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

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.

☕
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> 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

Anchor
Tooltip
Demo Code
HTML Code
<div class="demo-stage">
	<div class="demo-anchor">Anchor</div>
	<div class="demo-element">Tooltip</div>
</div>
CSS Code
.demo-stage {
	position: relative;
	width: 300px;
	height: 190px;
	background: #f4f4f4;
	outline: 1px dashed #b0b0b0;
}
.demo-anchor {
	position: absolute;
	left: 100px;
	top: 70px;
	width: 100px;
	height: 50px;
	display: grid;
	place-items: center;
	background: #4361ee;
	color: #fff;
	anchor-name: --demo-anchor;
}
.demo-element {
	position: absolute;
	position-anchor: --demo-anchor;
	margin: 4px;
	padding: 4px 8px;
	background: #f72585;
	color: #fff;
	font-size: 13px;
	position-area: top;
}

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

<div class="wrap">
<h1>CSS &lt;position-area&gt; examples</h1>
<div class="card stage">
<div class="anchor">Anchor</div>
<span class="tag t1">top center</span>
<span class="tag t2">bottom center</span>
<span class="tag t3">center left</span>
<span class="tag t4">center right</span>
<span class="tag t5">top right</span>
<span class="tag t6">bottom span-left</span>
</div>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
.stage {
  position: relative;
  height: 260px;
  display: grid;
  place-items: center;
}

.anchor {
  anchor-name: --target;
  width: 110px;
  height: 60px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.tag {
  position: absolute;
  position-anchor: --target;
  margin: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.t1 { position-area: top center; }
.t2 { position-area: bottom center; }
.t3 { position-area: center left; }
.t4 { position-area: center right; }
.t5 { position-area: top right; background: #7c3aed; }
.t6 { position-area: bottom span-left; background: #16a34a; }
Open in editor

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.

This data type 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