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.
Syntax
/* 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;
anchor-scope Browser support
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+