How do I mark up a navigation area without labeling every group as navigation?
Quick answer
Use <nav> for a major block of links that helps people navigate, such as a site menu or table of contents—not for every collection of links. A page can have more than one <nav> when the areas serve distinct navigation purposes. When appropriate, identify each with aria-labelledby and a heading that describes its purpose, so the areas are easier to distinguish. [S1]
The question, the details, the next step.
A practical checklist
Identify link groups that serve a major navigation purpose; do not mark every group as
<nav>.For each candidate, describe what it helps a reader navigate.
Use separate
<nav>elements for distinct navigation areas.When appropriate, add a heading and reference it with that area’s
aria-labelledby.Review multiple areas’ labels together to make sure their purposes can be told apart.
A few more useful answers
Does every set of links need a `<nav>` element?
No. Use <nav> for a major block of navigation links, not every link or link group. [S1]
Can a page have a site menu and an in-page contents area in separate `<nav>` elements?
Yes. MDN gives site navigation and in-page navigation as examples of multiple <nav> elements on a page. Label them with aria-labelledby when appropriate. [S1]
What should I call two different navigation areas?
Choose labels that describe their different purposes, such as “Site menu” and “On this page,” rather than repeating a generic label.
Sources
References used for this guide.
- [S1] The HTML nav navigation section element — MDN developer.mozilla.org · Checked
