Skip to main content
No Result Found

menu-landmark

Ensure that menus are placed within a landmark region so that assistive technologies like screen readers can easily discover them.

Rule Severity : Serious

Description

Assistive technologies like screen readers can detect menus on webpages easily if you define them within a landmark. If webpages have menus outside landmarks, assistive technologies can’t identify them accurately, causing inconsistent user experience for users of assistive technologies.

You can use HTML5’s nav element or include a role attribute that equals to navigation to indicate a navigation landmark for screen readers.

Example

In the following example, the menu is without any landmark element. Such cases fail the menu-landmark rule.

Incorrect sample - no landmark
Copy icon Copy

In the following example, the menu is within the landmark element nav. This makes it easy for assistive technologies like screen readers to identify the menu. So, this example does not break the menu-landmark rule.

Correct sample - nav
Copy icon Copy

Similarly, the following code snippet uses role="navigation" to accurately define the navigational landmark. So, this example also does not break the menu-landmark rule.

Correct sample - role=navigation
Copy icon Copy

How to fix?

You can follow these steps to fix issues if this rule gets flagged:

  • Check if your site has menus. If so, place the menu within a nav landmark.
  • As an alternative, add role="navigation" to enhance accessibility.

Reference

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle