Testing

CSS Anchor Positioning: Browser Support, Features, Issues

CSS Anchor Positioning supports Chrome 125+, Edge 125+, Firefox 147+, Opera 111+, Samsung Internet 27+, and Safari 26. See full browser support details.

Author

Prince Dewani

May 1, 2026

CSS Anchor Positioning is a W3C CSS module that lets a target element size and position itself relative to an anchor in pure CSS, with no JavaScript glue. It works in Chrome 125+, Edge 125+, Opera 111+, Samsung Internet 27+, Firefox 147+, and Safari 26 on Apple platforms, while Internet Explorer never added support.

This guide covers what CSS Anchor Positioning is, the browsers that support it, the key features, use cases, support checks, and known issues.

What is CSS Anchor Positioning?

CSS Anchor Positioning is a W3C CSSWG module that lets one element act as an anchor and another element size and position itself against that anchor in pure CSS. The entry points are the anchor-name and position-anchor properties plus the anchor() and anchor-size() functions.

Which browsers does CSS Anchor Positioning support?

CSS Anchor Positioning now ships by default in every major engine. Coverage hardened across late Chromium and Firefox builds, plus Safari 26 on Apple devices.

Loading browser compatibility data...

CSS Anchor Positioning compatibility in Chrome

Chrome supports CSS Anchor Positioning from Chrome 125 on Windows, macOS, ChromeOS, Linux, and Android. Chrome 117 to 124 had the API disabled by default behind the chrome://flags/#enable-experimental-web-platform-features flag, and Chrome 4 to 116 did not support it. Chrome 129 renamed inset-area to position-area, so always target the spec name in production.

CSS Anchor Positioning compatibility in Edge

Microsoft Edge supports CSS Anchor Positioning from Edge 125 on Windows, macOS, and ChromeOS through the same Chromium pipeline as Chrome. Edge 117 to 124 carried it behind the edge://flags/#enable-experimental-web-platform-features flag, and Edge 12 to 116 did not support it.

CSS Anchor Positioning compatibility in Firefox

Firefox supports CSS Anchor Positioning from Firefox 147 on Windows, macOS, Linux, and Android by default. Firefox 145 to 146 had it disabled by default behind the layout.css.anchor-positioning.enabled preference, and Firefox 2 to 144 did not support it.

CSS Anchor Positioning compatibility in Safari

Safari supports CSS Anchor Positioning from Safari 26 on macOS Tahoe 26, iOS 26, iPadOS 26, and visionOS 26. Safari 3.1 to 18.7 did not support it on any Apple platform. Chrome and Edge on iOS and iPadOS rely on the WebKit engine, so they inherit Safari's status.

CSS Anchor Positioning compatibility in Opera

Opera supports CSS Anchor Positioning from Opera 111 on Windows, macOS, and Linux through the Chromium 125 base. Opera 103 to 110 carried it behind the opera://flags/#enable-experimental-web-platform-features flag, and Opera 9 to 102 did not support it.

CSS Anchor Positioning compatibility in Samsung Internet

Samsung Internet supports CSS Anchor Positioning from Samsung Internet 27 on Galaxy phones and tablets. Samsung Internet 4.0 to 26 did not support the anchor-name, position-anchor, or anchor() surface at all.

CSS Anchor Positioning compatibility in Android Browser

The legacy stock Android Browser, frozen at version 4.4 before Chrome for Android took over, does not support CSS Anchor Positioning. On modern Android phones, use Chrome for Android 147 or later, Samsung Internet 27, or another modern Chromium-based browser instead.

CSS Anchor Positioning compatibility in Internet Explorer

Internet Explorer never added CSS Anchor Positioning. IE 5.5 through IE 11 cannot parse anchor-name, position-anchor, or position-area. Microsoft has retired Internet Explorer, so use Edge, Chrome, or Firefox for any anchor-positioning work.

Note

Note: CSS Anchor Positioning behaves differently across Chromium, Firefox, and Safari builds. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

What are the key features of CSS Anchor Positioning?

The module ships a small property and function set that replaces several JavaScript layout patterns. Each piece composes with regular CSS positioning, so layouts stay declarative.

  • anchor-name and position-anchor: Pair an anchor element with a positioned target through a single dashed-ident identifier, with no DOM walking or ResizeObserver glue.
  • anchor() function: Read the inset edges of an anchor and pin a target's top, right, bottom, or left to any side of that anchor.
  • anchor-size() function: Size the target to match the width, height, or any inset of the anchor, which keeps tooltips and popovers in proportion.
  • position-area property: Place the target inside a 9-cell grid around the anchor through keywords like top center or bottom right, so authors skip pixel math.
  • position-try-fallbacks and @position-try: Define a list of fallback positions that the browser tries when the primary placement overflows the viewport, replacing manual collision logic.
  • position-visibility: Hide the target automatically when the anchor scrolls off screen or out of its containing block, useful for menu and tooltip cleanup.
  • Top-layer integration: anchor() resolves from elements promoted to the top layer through popover or dialog, so menus stay accurate even after open() or showPopover().

What are the use cases of CSS Anchor Positioning?

Anchor Positioning collapses the JavaScript that used to drive overlays, menus, and field labels. The same CSS handles desktop and mobile placement without extra observers.

  • Tooltips and info bubbles: Pin a tooltip to its trigger button with anchor() and let position-try-fallbacks flip the bubble to the opposite side when the viewport runs out of room.
  • Popover menus and submenus: Anchor a popover to its toggle so the menu stays glued to the button when the user scrolls, resizes, or rotates the device.
  • Form field labels and validators: Float validation messages next to the input that fired them, even when the input sits inside a scrollable form section.
  • Custom select dropdowns: Build select widgets that place the option list under the trigger and flip above when the bottom of the page is near.
  • Connector lines and callouts: Compute callout endpoints with anchor() and anchor-size(), so SVG and CSS lines track the anchor without ResizeObserver math.
  • Settings dialogs and tour overlays: Tether on-page hints to the feature they explain, which keeps the hint visible as the user scrolls a long page.
  • Dynamic chart labels and footnotes: Bind a label to a data point, an axis tick, or a footnote marker, and let the label flow with layout changes.
...

How do you check if a browser supports CSS Anchor Positioning?

CSS exposes a one-line @supports gate, and JavaScript exposes feature detection through CSS.supports(). Both run inside the browser with no build step.

  • Open DevTools console: Press F12 or right-click the page and choose Inspect, then switch to the Console tab.
  • Run the @supports check: Paste CSS.supports("anchor-name: --foo") into the console and press Enter. A return value of true means the browser parses anchor-name.
  • Probe position-anchor: Run CSS.supports("position-anchor: --foo") to confirm the target side of the API works in the same browser build.
  • Test the anchor() function: Run CSS.supports("top: anchor(bottom)") to confirm the function is wired up; older builds parse anchor-name but not anchor().
  • Wrap your styles in @supports: Add @supports (anchor-name: --x) and (position-anchor: --x) so unsupported browsers fall back to the legacy positioning code.
  • Run the snippet below: Paste it into the console or ship it inside your page to log a single ready or not-ready line.
function checkAnchorPositioning() {
    const parsesAnchorName = CSS.supports("anchor-name: --tip");
    const parsesPositionAnchor = CSS.supports("position-anchor: --tip");
    const parsesAnchorFunc = CSS.supports("top: anchor(bottom)");

    if (parsesAnchorName && parsesPositionAnchor && parsesAnchorFunc) {
        console.log("CSS Anchor Positioning is ready in this browser.");
        return true;
    }
    console.log("CSS Anchor Positioning is not fully available. Load the polyfill or fall back to absolute positioning.");
    return false;
}

checkAnchorPositioning();

If only anchor-name returns true but anchor() returns false, the browser is on a transitional Chromium build with the property parser ahead of the function. Use the polyfill on those builds.

What are the known issues with CSS Anchor Positioning?

CSS Anchor Positioning is the youngest module in the layout family, and the rough edges show up around older browser builds, polyfill gaps, and a couple of evolving syntax decisions.

  • Apple devices on older OS releases miss it: Safari 26 added support, but iPhones on iOS 25, iPads on iPadOS 25, and Macs on macOS Sonoma or earlier do not ship it, even after Safari updates.
  • Polyfill is partial: The Oddbird CSS Anchor Positioning polyfill covers anchor() and the basic anchor-name binding, but it does not implement every position-area, position-try-fallbacks, or anchor-size() detail.
  • Syntax churn during rollout: Chrome 125 originally shipped inset-area and position-try-options; Chrome 129 renamed them to position-area and position-try-fallbacks, so older blog posts point at obsolete names.
  • Top-layer interaction is order-sensitive: anchor() from a popover only resolves when the anchor element shares the containing block; nested popovers can lose the binding and render at the viewport origin.
  • No DevTools picker yet: Chrome and Firefox DevTools surface anchor() values inside Computed Styles, but neither has a click-to-anchor helper, so debugging fall-through fallbacks still means scrolling Console output.
  • Test runners may need a flag: Headless Chromium versions earlier than 125 still need the --enable-blink-features=CSSAnchorPositioning switch, which trips up CI pipelines pinned to older Chrome for Testing builds.
  • Mobile WebView lag: Android WebView and iOS WKWebView track their host engine, so hybrid apps inherit the engine's gap; an Android 13 WebView on Chromium 120 has zero anchor-positioning support.

In my experience, the trickiest production failure is shipping a tooltip that flips correctly in Chrome 125 yet collapses to viewport (0, 0) in a slightly older Edge build because position-try-options was renamed to position-try-fallbacks. Detect both names with CSS.supports() before you trust either.

...

Citations

All CSS Anchor Positioning version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests