Primary navigation moves people around the whole site. Secondary navigation may explore a section; breadcrumbs describe where the current page sits in the hierarchy. The important question is always where the link leads and whether the person reading the page can predict it.
What You Need to Know
These are different relationships, so label each nav region clearly and use lists when the links form a meaningful collection.
Links are the pathways through a website. The words on a link should help someone choose where to go before clicking it.
Example: See It in Action
Try this markup in a fresh practice file. The next section explains the parts worth paying attention to.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<header>
<nav aria-label="Primary"><a href="index.html">Home</a>
</nav>
</header>
<main>
<nav aria-label="Breadcrumb"><a href="books.html">Books</a>
</nav>
<nav aria-label="Related reading"><a href="reviews.html">Reviews</a>
</nav>
</main>
Let’s Understand the Example
- An a element becomes a working link when it has an href. Its visible text should tell readers where they will go.
- Nav identifies a major collection of navigation links.
- Header introduces a page or section, often with a title and navigation.
- Aria-label supplies an accessible name when a visible label is unavailable or inadequate.
- Href contains the destination of a link. A value starting with # points to an id on the same page.
The first example link points to index.html. Check whether that destination exists relative to the document. A link changes where readers go; it does not perform an action such as saving a form.
What Should You See?
You should see a link named “Home”. Selecting it leads to index.html when that destination exists. Try it with the mouse and the keyboard.
Imagine this link is read out of context. Would its text still explain the destination? Rename unclear links before trying to make them look nicer with CSS.
Try It Yourself
- Add a related-reading nav without calling it the main menu.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Combining breadcrumb ancestors and unrelated menu items into one confusing list.
- Avoid dead links, empty href values and clickable-looking text without a real destination.
Key Takeaways
- Primary navigation moves people around the whole site.
- An a element becomes a working link when it has an href. Its visible text should tell readers where they will go.
- These are different relationships, so label each nav region clearly and use lists when the links form a meaningful collection.