A technique for hiding interactive UI elements (share buttons, skip links, copy buttons) while keeping them accessible to hover, focus, find-in-page, and fragment navigation. The approach combines the HTML `hidden="until-found"` attribute with CSS `contain-intrinsic-size: auto none` to reserve layout space and prevent layout shift. A 1ms `@keyframes` animation briefly renders the element so its size is captured, while `opacity: 0` prevents flickering. The element is then revealed via `&:is(:hover, :focus, :not([hidden]))`. Quirks include find-in-page content persisting after discovery and Safari requiring Tab+Option for button focus.
Table of contents
The HTML ( hidden=until-found )The CSS (mostly contain-intrinsic-size: auto none )Final Thoughts5K Impressions