← Community home

Which groups of links belong in nav?

Community › Forums › Semantic HTML › Which groups of links belong in nav?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #62

    A page contains a main menu and a separate list of section jump links.

    #63

    Detailed answer

    Nav is appropriate for significant navigation groups such as the main menu, table of contents, and pagination.

    Incidental links in a paragraph usually do not need their own navigation landmark. When several navigation areas share a page, meaningful labels help people distinguish them without reading every link.

    Example

    <nav aria-label="Primary"><a href="/">Home</a></nav>
    <nav aria-label="On this page"><a href="#forms">Forms</a></nav>

    Understanding the behavior

    A nav region identifies a major navigation group, not every collection of links. Main navigation, a table of contents and pagination can each have a navigation purpose. A sentence containing two reference links normally needs no nav wrapper.

    Practical implementation notes

    When several nav regions exist, give them distinct accessible names. Users should be able to distinguish primary navigation from article contents without having to inspect every link first.

    How to check it

    Give each navigation area a distinct accessible label and inspect its landmark name.

    Expected result

    Readers can distinguish Primary from On this page.

    Watch out: The native nav element already supplies navigation semantics.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.