---
title: "A gentle introduction to anchor positioning"
description: "CSS anchor positioning lets you place an element, such as a popover menu or tooltip, relative to another element without JavaScript."
url: "https://swe.quest/articles/a-gentle-introduction-to-anchor-positioning-82b8616c476c9307"
canonical: "https://webkit.org/blog/17240/a-gentle-introduction-to-anchor-positioning/"
source: "WebKit"
published: "2025-08-12"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["css","frontend","browsers"]
---

# A gentle introduction to anchor positioning

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2025-08-12, 8 min read, How-to. Original: [https://webkit.org/blog/17240/a-gentle-introduction-to-anchor-positioning/](https://webkit.org/blog/17240/a-gentle-introduction-to-anchor-positioning/)

## Summary

CSS anchor positioning lets you place an element, such as a popover menu or tooltip, relative to another element without JavaScript. You declare \`anchor-name\` on the anchor, \`position-anchor\` on the absolutely or fixed positioned target, and then place the target either with \`position-area\`, a nine-cell grid centered on the anchor, or with the \`anchor()\` function inside inset properties. Values like \`block-end span-inline-end\` give left-aligned dropdowns, and \`position-try\` supplies a fallback position when space runs out, for example on mobile. The examples favor logical values over physical ones, and \`anchor()\` can be combined with \`calc()\` for fine alignment offsets.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)

## Prerequisites

- CSS positioning ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))
- CSS logical properties ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

CSS anchor positioning, position-area, anchor(), position-try, Popover API, WebKit

## Related posts

- [Release Notes for Safari Technology Preview 227](https://swe.quest/articles/release-notes-for-safari-technology-preview-227-119e49c133d89d81.md): WebKit · 2025-09-03 · Easy · 5 min read · Browsers, CSS, Frontend, WebAssembly
  Safari Technology Preview 227 (WebKit 298484@main…299099@main) adds the Navigation API, the scrollend event, command/commandfor button attributes for declarative popover and dialog control, and CSS field-sizing, scrollbar-color, position-visibility and math-shift.
- [News from WWDC26: WebKit in Safari 27 beta](https://swe.quest/articles/news-from-wwdc26-webkit-in-safari-27-beta-4f7db5fa3d901641.md): WebKit · 2026-06-08 · Medium · 57 min read · Browsers, CSS, Frontend, WebAssembly, Accessibility
  Safari 27 beta ships 58 new features, 525 fixes and 4 deprecations, with most of the work going into correctness, edge cases, cross-feature interactions and alignment with web standards and other browsers.
- [A guide to Scroll-driven Animations with just CSS](https://swe.quest/articles/a-guide-to-scroll-driven-animations-with-just-css-4e60392ccf274304.md): WebKit · 2025-06-20 · Medium · 9 min read · CSS, Frontend, Browsers, Accessibility
  CSS scroll-driven animations, now supported in Safari 26 beta, tie keyframe animations to scroll position instead of time using the animation-timeline property, with no JavaScript required.
- [Release Notes for Safari Technology Preview 243](https://swe.quest/articles/release-notes-for-safari-technology-preview-243-b654215c3d2767b1.md): WebKit · 2026-05-07 · Medium · 18 min read · Browsers, CSS, Accessibility, JavaScript
  Safari Technology Preview 243 ships WebKit changes 310600@main through 312007@main for macOS Tahoe and Sequoia.
- [Make creative borders with background-clip border-area](https://swe.quest/articles/make-creative-borders-with-background-clip-border-area-cdba7fcc9b39e6d8.md): WebKit · 2024-11-20 · Medium · 10 min read · CSS, Browsers, Frontend
  \`background-clip: border-area\`, available in Safari Technology Preview and Safari 18.2 beta, clips a background image or gradient to the border region.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
