<anchor-size>

A function that retrieves the width or height of the anchor element. It's incredibly useful for making a popup or menu match the exact dimensions of the button that triggered it.

/* Usage Example */
.tooltip {
  /* Makes the tooltip exactly as wide as its anchor */
  width: anchor-size(width);
  position: absolute;
}
Limited availability Since 2020 77% global usage

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

125+
125+
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