Skip to content

Hidden content needs to be checked when it shows

  • Rule: axe/hidden-content
  • Checks: Hidden content on the page should be analyzed
  • WCAG: none; a best practice, not a WCAG success criterion
  • Fix class: manual: A fix needs a person to work out what to change, beyond authored text or a visual decision.
  • People who use a screen reader or a braille display, most of them blind.
  • People who use a keyboard or a switch device instead of a mouse.

A menu, a dialog, a tab panel or a collapsed section was hidden during the scan

Section titled “A menu, a dialog, a tab panel or a collapsed section was hidden during the scan”

This reports content the scan could not check, not a fault: axe skips content hidden with display: none or visibility: hidden. Open or expand it, then scan the page in that state.

The content is meant to stay hidden, such as an inactive view or a template

Section titled “The content is meant to stay hidden, such as an inactive view or a template”

Leave it. The hidden attribute and display: none are the right ways to hide content from everyone.

Moving the content off-screen or giving it opacity: 0 so that axe checks it

Section titled “Moving the content off-screen or giving it opacity: 0 so that axe checks it”

axe can then check it, but screen readers read it and its controls take focus while nothing shows on screen.

axe-core’s documentation of the rule

CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.