Free, independent guides since 2010

Accessibility

Accessible menus and navigation

How to build accessible website navigation: nav landmarks, dropdown and mega menus, mobile menu buttons, current page indication, breadcrumbs, skip links, search and consistent navigation.

<guide section="Accessibility" type="article" read="1 min"/>

Navigation is the backbone of a website. If it fails for keyboard or screen reader users, they cannot reach anything. This site’s tab-style mega menu is built with the principles below. For the design side, see designing navigation.

Basic structure

HTML
<nav aria-label="Main">
  <ul>
    <li><a href="index.html" aria-current="page">Home</a></li>
    <li>
      <button type="button" aria-expanded="false" aria-controls="sub-services">Services</button>
      <ul id="sub-services" hidden>
        <li><a href="repairs.html">Repairs</a></li>
        <li><a href="servicing.html">Servicing</a></li>
      </ul>
    </li>
    <li><a href="contact.html">Contact</a></li>
  </ul>
</nav>
  • Use a button to open the submenu; keep the parent page as a separate link if needed.
  • Update aria-expanded when opening and closing.
  • Close with Escape and return focus to the button.
  • Hover may open menus too, but with a small delay and never as the only way.
  • Panels must be reachable before focus moves on to the next item.

Mobile menus

  • A real <button> with a visible label or accessible name.
  • When open, focus moves into the menu; Escape or the button closes it.
  • Large touch targets (see mobile first).

Orientation

  • aria-current="page" on the active link, plus a visible indicator.
  • Breadcrumbs in their own labelled nav.
  • A skip link to the main content (see keyboard accessibility).
  • Search as an alternative route, with a labelled input.
  • Consistent order and placement on all pages.

Frequently asked questions

Are mega menus accessible?

They can be, when built as disclosure buttons that open panels with normal links, close with Escape and do not trap focus. Avoid complex application-style menu roles for website navigation.

Should the mobile menu button say “Menu”?

A visible “Menu” label next to the icon is clearer for many users than an icon alone, and it gives the button an accessible name.