Roles like main, banner, complementary, Enhancing navigation for assistive technologies #
Landmarks #
Landmarks are crucial for enhancing navigation on a website, as they help users quickly identify and access important sections of content. The following practices promote the effective use of landmarks to improve overall accessibility.
- Key page sections are defined, making it easy for screen reader users to understand the structure of the page.
- Screen reader users can quickly navigate between sections such as the header, navigation menu, main content area, and footer by using keyboard shortcuts for landmarks.
- Each landmark is unique and clearly represents its section (e.g., the `nav` element for primary navigation, `main` for main content).
- Landmarks are used consistently across the entire website, allowing screen reader users to rely on predictable navigation patterns from page to page.
- Landmarks are not improperly nested or overlapped, ensuring that users can easily distinguish and move between different areas.
- All critical sections of the page, such as main content, site navigation, and the footer, are appropriately tagged.
- The presence of landmarks complements other navigational aids like functional skip links.
Screen reader: NVDA
Videos:
HTML example that includes landmarks for banner, article, and carousel sections to enhance accessibility and navigation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Accessible Landmarks with Banner, Article, and Carousel</title>
</head>
<body>
<!-- Banner Landmark -->
<header role="banner">
<h1>Company Name</h1>
<nav role="navigation" aria-label="Main Navigation">
<ul>
<li><a href="/home">Home</a></li>
<li><a href="/about">About Us</a></li>
<li><a href="/services">Services</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
</header>
<!-- Carousel Landmark -->
<section aria-labelledby="carousel-heading" role="region">
<h2 id="carousel-heading">Featured Products</h2>
<div id="carousel" role="region" aria-roledescription="carousel" aria-label="Product carousel">
<button aria-label="Previous Slide">Previous</button>
<div>
<img src="product1.jpg" alt="Product 1" />
<img src="product2.jpg" alt="Product 2" />
<img src="product3.jpg" alt="Product 3" />
</div>
<button aria-label="Next Slide">Next</button>
</div>
</section>
<!-- Main Content Landmark -->
<main id="main-content" role="main">
<h2>Welcome to Our Website</h2>
<p>We are committed to delivering high-quality services that meet the needs of our clients. Learn more about our team and what we do below.</p>
<!-- Article Landmark -->
<article role="article" aria-labelledby="article1-heading">
<h3 id="article1-heading">How Our Services Help You</h3>
<p>Our team offers a wide range of services designed to meet the unique needs of each client...</p>
<a href="#">Read more</a>
</article>
</main>
<!-- Complementary Landmark for Sidebar -->
<aside role="complementary" aria-labelledby="sidebar-heading">
<h3 id="sidebar-heading">Related Information</h3>
<ul>
<li><a href="#">Latest News</a></li>
<li><a href="#">Customer Testimonials</a></li>
<li><a href="#">Case Studies</a></li>
</ul>
</aside>
<!-- Footer Landmark -->
<footer role="contentinfo">
<p>© 2024 Company Name. All rights reserved.</p>
<nav aria-label="Footer Navigation">
<ul>
<li><a href="/privacy">Privacy Policy</a></li>
<li><a href="/terms">Terms of Service</a></li>
<li><a href="/contact">Contact Us</a></li>
</ul>
</nav>
</footer>
</body>
</html>
Key Features of the Updated Example: #
- Banner Landmark (
role="banner"):- The
<header>element defines the banner of the page, which typically includes the company name or logo and the main navigation.
- The
- Carousel Landmark (
role="region"andaria-roledescription="carousel"):- The carousel is marked with
role="region"andaria-roledescription="carousel", which helps screen reader users understand that this is a carousel or slideshow. - Navigation buttons have
aria-labelattributes to describe their function (e.g., “Previous Slide” and “Next Slide”). - This makes the carousel accessible by providing clear instructions and navigation controls for assistive technology users.
- The carousel is marked with
- Main Content Landmark (
role="main"):- The
<main>element still defines the main content of the page.
- The
- Article Landmark (
role="article"):- The
<article>element usesrole="article", which defines standalone content that could be distributed or syndicated. In this case, it’s an article about the company’s services.
- The
- Complementary Landmark (
role="complementary"):- The
<aside>element continues to be used as a complementary region for related information.
- The
- Footer Landmark (
role="contentinfo"):- The
<footer>element is defined withrole="contentinfo", identifying it as the footer content.
- The
Best Practices : #
- Banner Landmark: Defines the main header of the site, which typically includes navigation.
- Carousel Landmark: Provides clear roles and labels for carousel controls to ensure the component is navigable and understandable for screen reader users.
- Article Landmark: Ensures that individual articles are distinguishable and easily accessible by assistive technologies.
- Consistent Use of Landmarks: Landmarks such as banner, main, article, and footer are consistently used, improving predictability for users relying on screen readers.