Ensure Consistent Navigation Order Across Pages
Why It Matters
Consistency in navigation placement and order helps users learn how to use a website quickly. Users with cognitive disabilities rely on predictability. Screen reader users and keyboard users benefit from knowing where navigation links will appear on each page, allowing them to navigate more efficiently without having to reorient themselves constantly.
Fixing the Issue
Identify blocks of navigation (like main menus, breadcrumbs, footer links) that appear on multiple pages. Ensure these blocks appear in the same place and the links within them are in the same order across all pages where they are present. Use templates or include files for repeated navigation blocks to maintain consistency easily.
Good Code Example
Using consistent header and footer navigation across pages:
-
<body> <header> <nav> <a href="/">Home</a> | <a href="/about">About</a> | <a href="/contact">Contact</a> </nav> </header> <main>...</main> <footer> <a href="/privacy">Privacy Policy</a> | <a href="/terms">Terms</a> </footer> <body> <header> <nav> <a href="/">Home</a> | <a href="/about">About</a> | <a href="/contact">Contact</a> </nav> </header> <main>...</main> <footer> <a href="/privacy">Privacy Policy</a> | <a href="/terms">Terms</a> </footer> </body></body>
Bad Code Example
Navigation links change order on different pages:
-
<body> <header> <nav> <a href="/">Home</a> | <a href="/products">Products</a> | <a href="/support">Support</a> </nav> </header> ... <body> <header> <nav> <a href="/">Home</a> | <a href="/support">Support</a> | <a href="/products">Products</a> </nav> </header> ... </body></body>
