anchor-scope

Limits where an anchor name can be 'seen.' This prevents anchor names from leaking into other parts of the page, allowing you to reuse the same anchor names in different components safely.

It is documented as part of the CSS Anchor Positioning specification.

/* Usage Example */
.card-container {
  /* Anchor names inside this card won't be visible outside it */
  anchor-scope: --card-anchor;
}

/* Syntax */
anchor-scope: none;
anchor-scope: all;

/* Global values */
anchor-scope: inherit;
anchor-scope: initial;
anchor-scope: revert;
anchor-scope: revert-layer;
anchor-scope: unset;
Limited availability Since 2020 76% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

131+
131+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC