HTML & CSS · Senior · Question 32 of 75
What is CSS Anchor Positioning used for?
- ✓Correct answer: Tethering a tooltip or popover to another element without JS calculations
- 2Smoothly scrolling the page to a
#sectionanchor when a link is clicked - 3Pinning an element to the bottom of the screen over content, like
sticky
Explanation
An anchor is declared with anchor-name: --btn, and the positioned element references it via position-anchor and the anchor() function (or position-area). Fallbacks exist for lack of space (position-try-fallbacks). This used to require libraries like Floating UI. Browser support isn't complete everywhere yet - check it before use.