Skip to main content
No Result Found

search-landmark

Ensure that search bars 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 search boxes on webpages easily if you define them within a landmark. If webpages have search bars outside landmarks, assistive technologies can’t identify them accurately, causing inconsistent user experience for users of assistive technologies.

Example

In the following example, the search bar is without any landmark element. Such cases break the search-landmark rule.

Incorrect sample - no landmark
Copy icon Copy

In the following example, the search bar is within a landmark using <div role="search">. This makes it easy for assistive technologies like screen readers to identify the search bar. So, this example does not break the search-landmark rule.

Correct sample - div role = search
Copy icon Copy

Similarly, the following code snippet uses <form role="search"> to accurately define the search landmark. So, this example also does not break the search-landmark rule.

Correct sample - form role=search
Copy icon Copy

How to fix?

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

  • Check if your site has a search functionality.
  • If so, place the search bar within a landmark using (`role=”search”’).

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