--- title: "Hidden until found" category: accessibility status: recommended url: https://webspecification.com/spec/accessibility/hidden-until-found/ updated: "2026-05-31T17:50:00.000Z" sources: - title: "HTML Standard — The hidden attribute" url: "https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute" publisher: "WHATWG" - title: "CSS Containment Module Level 2 — Using content-visibility: hidden" url: "https://www.w3.org/TR/css-contain-2/#using-cv-hidden" publisher: "W3C" - title: "MDN — hidden global attribute" url: "https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/hidden" publisher: "MDN" - title: "Chrome for Developers — hidden=until-found and the beforematch event" url: "https://developer.chrome.com/articles/hidden-until-found" publisher: "Google" source_repo: undefined licence: CC-BY-4.0 --- # Hidden until found > Use hidden="until-found" for collapsible content so that browser find-in-page, assistive tech, and search engines can still reach the text and auto-expand it. ## What it is `hidden="until-found"` is a value of the global `hidden` attribute defined in the HTML Standard. An element marked this way renders as if hidden — it takes up no visible space — but the browser's find-in-page (Ctrl/Cmd+F), the fragment-directive scroll-to-text, and `scrollIntoView()` still walk through it. When a match is found inside, the browser fires a `beforematch` event on the element, removes the `hidden` attribute, and scrolls the match into view. The browser's user-agent stylesheet applies `content-visibility: hidden` to elements in the until-found state, and the find-in-page algorithm has a specific exception for that state — when a match would land inside the subtree, it walks the element, removes the `hidden` attribute, and scrolls into view. **Applying `content-visibility: hidden` directly in author CSS does not get you the same behaviour.** Per the CSS Containment specification, contents in that state are skipped from rendering *and* are not visible to screen readers, find-in-page, or other tools. The reachability is a property of the HTML attribute, not the CSS property. ## Why it matters - `display: none` removes content from the accessibility tree and from find-in-page entirely. Accordion or tab patterns that hide panels with `display: none` are invisible to a user who knows the exact phrase they want. - Find-in-page is a primary accessibility tool. Keyboard users, screen-reader users, users with cognitive disabilities, and anyone skimming a long document rely on it to locate content directly. - Search engines and AI crawlers vary in how they treat content hidden with `display: none`. `hidden="until-found"` keeps the text in the DOM and reachable, which is the honest signal: this is real content, just collapsed by default. ## How to implement Mark each collapsed panel and listen for `beforematch` so your widget state stays in sync: ```html