CSS Anchor Positioning: How to Build Tooltips and Popovers Without JavaScript
CSS Anchor Positioning is a browser-native feature that lets you position any absolutely-placed element relative to another element in the document - no JavaScript required. Using the anchor() function, position-anchor property, and @position-try rules, you can build fully interactive tooltips, dropdown menus, and context menus in pure CSS and HTML. As of early 2026, it works in Chrome 125+, Firefox 132+, and Safari 18.2+, covering roughly 91% of browser traffic. Combined with the HTML popover attribute (Baseline 2024), you get show/hide toggling, keyboard dismissal, and top-layer stacking for free. The JavaScript tooltip library is effectively dead for most use cases.







