What Are HTML Landmark Roles?
Landmark roles are defined in the Accessible Rich Internet Applications (ARIA) specification as regions of a page that users might want quick access to. While these landmarks benefit all users who rely on keyboard navigation and skip links, they are particularly essential for screen reader users who cannot perceive the visual layout that guides sighted users through a page.
When you use semantic HTML elements correctly, assistive technologies can announce the purpose of each major section, allowing users to jump directly to the content they need without having to navigate through every element sequentially.
The power of landmark roles lies in their ability to represent structural information that is conveyed visually through layout into a programmatic format that assistive technologies can exploit. A sighted user can instantly identify a header, main content area, navigation menu, and footer based on visual positioning. A screen reader user can achieve the same understanding when those sections are properly marked up with semantic elements or ARIA roles.
Implementing landmark roles is not just about accessibility compliance--it reflects a user-centered design philosophy that prioritizes the experience of every visitor to your website. When your interface communicates its structure programmatically, you create a foundation that supports better navigation, clearer content organization, and ultimately, higher conversion rates.
| Landmark Role | Purpose | HTML Element |
|---|---|---|
| banner | Site-oriented content at page beginning, typically containing logo and search | <header> (body context only) |
| navigation | Collection of links for website or page navigation | <nav> |
| search | Collection of items that create search functionality | <search> or <form role="search"> |
| main | Primary content of the page | <main> |
| region | Perceivable section with important content | <section> (with accessible name) |
| complementary | Content that complements main content | <aside> |
| form | Collection of items that create a form | <form> (with accessible name) |
| contentinfo | Information about page content, typically footer | <footer> (body context only) |
HTML Elements That Create Landmarks
One of the most powerful aspects of landmark roles is that many native HTML elements automatically create the appropriate landmark without requiring any ARIA attributes at all. Following the first rule of ARIA, which states that you should use native HTML elements with built-in semantics rather than adding ARIA roles to non-semantic elements, you can achieve full landmark support through semantic markup alone.
Element-to-Landmark Mappings
The header element defines a banner landmark when its context is the body element. However, when a header is used inside an article, aside, main, nav, or section element, it does not receive the banner role. This contextual behavior ensures that nested headers within content sections don't confuse the accessibility tree.
The nav element implicitly has the navigation role, making it ideal for primary and secondary navigation menus. Because a page often contains multiple navigation sections, each nav element should have a unique label using aria-label or aria-labelledby. This labeling practice connects directly to our approach to intuitive navigation design, where users can quickly find their way through your site.
The main element directly maps to the main landmark role, representing the primary content of the page. A page should contain exactly one main element as a top-level landmark. This singular focus on main content aligns with conversion optimization principles--keeping users focused on what matters most.
The aside element creates a complementary landmark, perfect for sidebars, related content sections, and supplementary information that enhances rather than defines the primary message.
The footer element defines a contentinfo landmark when used at the body level, but loses this role when nested inside other sectioning elements. This mirrors how footer content typically relates to the entire page rather than any single section.
The form element creates a form landmark only when it has an accessible name. Without an accessible name, the form element does not expose the landmark role because not all forms are significant enough to warrant landmark status. This selective exposure prevents the accessibility tree from becoming cluttered with trivial form elements.
The section element requires an accessible name to create a region landmark. Without a label, a section element does not expose the region role because it lacks semantic meaning on its own.
The search element explicitly creates a search landmark and is the recommended approach for search functionality. Before this element was introduced, developers had to add role="search" to a form element to achieve the same result.
Best Practices for Landmark Implementation
Implementing landmark roles effectively requires following several key principles that ensure your accessible markup serves users rather than creating unnecessary noise in the accessibility tree.
Include All Perceivable Content
The most important principle is to include all perceivable content on a page in one of its landmark regions. This ensures that assistive technology users will not overlook information that is relevant to their needs. Every piece of content on your page should belong to a clearly identified region, creating a complete picture of what your page offers.
Use Top-Level Landmarks Correctly
Banner, main, complementary, and contentinfo landmarks should be top-level landmarks not contained within other landmarks. This hierarchical structure helps users understand the relationship between different regions of the page. Nesting landmarks appropriately can identify parent-child relationships in complex layouts, but the primary landmarks should be direct children of the body element.
Label Multiple Landmarks of the Same Type
When you use the same landmark role multiple times on a page, each instance must have a unique label to help users distinguish between them. For example, if you have primary navigation, footer navigation, and sidebar navigation, each should have a distinct label like "Primary," "Footer," and "Sidebar." The label should describe the purpose or location of the landmark, not repeat the role name.
Use Headings as Labels When Available
When a section begins with a heading element, use that heading as the label using the aria-labelledby attribute. This approach has the dual benefit of providing a programmatically associated label while also creating a visual heading that benefits all users.
Prefer Native HTML Over ARIA Attributes
Always prefer native HTML elements with implicit landmark roles over adding role attributes to non-semantic elements. Use <header> instead of <div role="banner">, and use <nav> instead of <div role="navigation">. Native elements provide the same accessibility benefits while being more maintainable, semantic, and easier for your development team to work with.
These best practices reflect a broader commitment to clean, semantic code that serves both users and developers equally.
1<header>2 <a class="logo" href="/">3 <span class="visually-hidden">Company Name</span>4 </a>5 <nav aria-label="Primary">6 <ul>7 <li><a aria-current="page" href="/">Home</a></li>8 <li><a href="/about">About</a></li>9 <li><a href="/services">Services</a></li>10 </ul>11 </nav>12</header>1<main>2 <article>3 <h1>Welcome to Our Service</h1>4 <p>This is the main content...</p>5 6 <section aria-labelledby="products-heading">7 <h2 id="products-heading">Our Products</h2>8 <p>Browse our collection...</p>9 </section>10 </article>11</main>1<section aria-labelledby="contact-heading">2 <h2 id="contact-heading">Contact Us</h2>3 <form aria-labelledby="contact-heading" action="/contact" method="post">4 <label for="name">Name</label>5 <input type="text" id="name" name="name">6 7 <label for="email">Email</label>8 <input type="email" id="email" name="email">9 10 <button type="submit">Send Message</button>11 </form>12</section>Common Mistakes to Avoid
Several common mistakes can undermine the effectiveness of your landmark implementation. Understanding these pitfalls helps you create truly accessible interfaces.
Using the Wrong Element
Using a div with role="navigation" when a nav element is available adds unnecessary complexity and may not be supported as well by all assistive technologies. Native HTML elements are the foundation of an accessible web--reach for them first.
Failing to Label Multiple Landmarks
Not labeling navigation sections creates confusion for screen reader users who cannot distinguish between different navigation areas. Without labels, multiple navigation landmarks would all be announced simply as "navigation," making it difficult for users to find the specific section they need.
Over-Landmarking Content
Applying landmarks to content that doesn't warrant navigation creates noise in the accessibility tree that makes it harder for users to find genuinely important sections. The region role should be used sparingly and only when no other landmark role appropriately describes the content.
Incorrect Nesting
Placing a banner inside a main element can prevent those landmarks from being exposed correctly or create confusing hierarchies that misrepresent the page structure. Landmarks should be properly nested to reflect the logical organization of your content.
Overusing the Region Role
The region role should be reserved for important sections that don't fit other landmark categories, not applied to every section of content. Using it indiscriminately dilutes its meaning and creates more noise than value for users navigating your interface.
By avoiding these common mistakes, you ensure that your landmark implementation genuinely improves the experience for users of assistive technologies rather than creating additional barriers.
Testing Your Implementation
To verify that your landmark implementation is working correctly, use browser developer tools to inspect the accessibility tree. Modern browsers provide accessibility inspectors that show how elements are interpreted by assistive technologies.
Browser Developer Tools
Firefox provides an Accessibility Inspector in the developer tools that allows you to examine how elements are exposed to assistive technologies. This tool shows the role, name, and description that assistive technologies will receive for each element.
Chromium-based browsers like Chrome, Edge, and Arc offer similar functionality through their accessibility tools. You can inspect any element and view its accessibility properties in the Elements panel.
Safari requires enabling the Web Inspector and selecting the Node tab to view accessibility information. Once enabled, you can examine how elements are exposed to assistive technologies.
When you inspect a properly marked up header element, you should see it identified as a banner landmark. Navigation elements should show as navigation landmarks with the label you provided. The main element should be clearly identified, and your form elements should show as form landmarks only when they have accessible names.
This testing approach helps ensure that your accessible markup is actually creating the landmark regions you intend. Regular testing throughout development catches issues like missing labels on repeated landmarks or elements that aren't exposing their landmark roles as expected--before they affect real users.
Integrating accessibility testing into your QA workflow ensures consistent quality across all the interfaces you build.
Frequently Asked Questions
Sources
- MDN Web Docs - ARIA: landmark role - Comprehensive documentation on the abstract landmark role and its relationship to HTML semantic elements
- MDN Blog - Using HTML landmark roles to improve accessibility - Practical guide with code examples showing how each landmark role works
- W3C WAI - Landmark Regions - Official W3C guidance on implementing landmark regions with best practices
- W3C ARIA Specification - Official specification defining eight landmark roles