Building basic website navigation
Inside this lesson
- The <nav> element
- A menu as a list of links
- Marking the current page with aria-current
- Breadcrumbs and footer links
Short answer
A website menu is a list of links inside a <nav> element. Use <ul> and <li> so screen readers announce how many items there are. Mark the page you are on with aria-current="page". Keep labels short and clear, and put the same menu on every page.
A basic menu
<header>
<nav aria-label="Main">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/menu/">Menu</a></li>
<li><a href="/about/" aria-current="page">About</a></li>
<li><a href="/contact/">Contact</a></li>
</ul>
</nav>
</header>
Without CSS, it shows as a bulleted list. You will turn it into a horizontal menu when you learn CSS. The HTML stays the same.
Mark the current page
aria-current="page" tells screen readers current page when they reach that link. You can also style it with CSS, for example with an underline, so sighted visitors know where they are.
Plan your menu labels
- Use the words customers use. Menu beats Our Culinary Offerings.
- Keep it to five to seven top links.
- Put the most important page, often Contact or Order, at the end where people expect it.
- Use the same order on every page.
Breadcrumbs and footer links
<nav aria-label="Breadcrumb">
<a href="/">Home</a> /
<a href="/products/">Products</a> /
<span aria-current="page">Pili Tarts</span>
</nav>
A breadcrumb shows where a page sits in the site. This lesson has one at the top. Footer navigation holds secondary links like Privacy Policy and Terms. If a page has more than one nav, give each an aria-label so screen reader users can tell them apart.
Try it: build a menu
Turn these loose links into a proper nav with a list. Mark Contact as the current page.
Live preview
Quick quiz
Common mistakes
- Too many menu items. Long menus overwhelm visitors, especially on phones.
- Clever labels. People scan for common words like Contact.
- Different menus per page. Keep navigation consistent everywhere.
- Every link group in nav. Use nav for major navigation, not for every link.
Your action
Tick each item when you can do it. Your progress saves on this device.
Key terms
- <nav>
- An element for major navigation links.
- aria-current
- Marks the current item in a set, like the current page.
- Breadcrumb
- A trail of links showing a page's location.
- aria-label
- Gives an element an accessible name.
- Internal link
- A link to another page on the same site.
Questions beginners ask
How do I make a mobile hamburger menu?
That needs CSS and a little JavaScript, or the HTML details element. Start with a plain list first.
Should the logo link to the homepage?
Yes, visitors expect that.
Does navigation help SEO?
Yes. Clear internal links help search engines find and understand your pages.
Related lessons
Need a website built or fixed while you practice? The team at Remar Digital can help.