aria-hidden="true" must not be present on the document <body>

Rule ID: aria-hidden-body
Ruleset: axe-core 3.2
User Impact: Critical
WCAG: 4.1.2

What if your accessibility tools could do more?

Axe can catch a lot of accessibility issues, but what if accessibility tools could do more? Join our beta program for a new tool that takes an exciting new approach to accessibility testing.

Compliance Data & Impact

User Impact

Disabilities Affected

  • Blindness

Requirement(s)

  • WCAG 2.1 (A): MUST
  • WCAG 2.0 (A): MUST

WCAG Success Criteria

  • 4.1.2 Name, Role, Value

Section 508 Guidelines

  • Not specified or not applicable

How to Fix the Problem

Remove the aria-hidden="true" attribute from the document body element.

Caution:

aria-hidden="false" is known to work inconsistently when used in conjunction with styles or attributes that have historically prevented rendering in all modalities, such as display: none, visibility: hidden in CSS, or the hidden attribute in HTML5. Use caution and test thoroughly before relying on this approach.

Reconsider the location of the hidden content to determine whether you can relocate it to an area of the page other than the body element. Typically, content is hidden from screen readers to reduce the unnecessary information that screen reader users would tend to skip (redundant or extraneous content).

Why this is Important

When <body aria-hidden="true", content is not accessible to assistive technology.

Applying aria-hidden="true" to otherwise accessible objects: A web page is designed to be fully accessible, and it would be accessible if elements do not contain the aria-hidden="true" attribute value. Screen readers do not read content marked with the aria-hidden="true" attribute value. Users can still tab to focusable elements in the hidden objects, but screen readers remain silent.

Any content or interface elements intentionally hidden from users — e.g., inactive dialogs, collapsed menus — must also be hidden from screen reader users. When items are available to sighted users — such as when they activate a button or expand a menu item — the same items must be available to screen reader users. The goal is to provide screen reader users an equivalent user experience to sighted users. If there is a compelling reason to hide content from sighted users, there is usually a compelling reason also to hide that content from blind users. Further, when content is made available to sighted users, it makes sense to make it available to blind users as well.

Rule Description

Document content is not accessible to assistive technology if <body aria-hidden="true">.

The Algorithm (in simple terms)

Checks for the presence of the aria-hidden="true" attribute the document's body element and alerts with a pass or fail message accordingly.

Resources

Other Resources

You may also want to check out these other resources.

Refer to the complete list of axe 3.2 rules.