HTML Navigation: Semantic Menus and Skip Links
Group major navigation
Use nav around major groups of navigation links. A list is a common way to express the group: ul is an unordered list and each li is one item. These list elements are introduced here briefly and covered in depth next chapter. Not every group of links needs a nav landmark.
<nav aria-label="Primary"> <ul> <li> <a href="index.html">Home</a> </li> <li> <a href="courses.html">Courses</a> </li> </ul></nav>A navigation landmark named Primary contains two links. The target files are illustrative.
Identify the current page
When a navigation group includes a link to the current page, aria-current="page" communicates that state to assistive technologies. Normally mark one current item in a set. Label different navigation landmarks with distinct names using aria-label when needed. These ARIA attributes describe semantics, not visual styling; full ARIA coverage comes later.
<nav aria-label="Primary"> <a href="index.html">Home</a> <a href="courses.html" aria-current="page">Courses</a></nav><nav aria-label="Help"> <a href="faq.html">FAQ</a></nav>Courses is marked as current; the two navigation landmarks have different names.
Provide a keyboard skip link
A skip link lets users bypass repetitive navigation. Place it before the navigation and point it to the main content. The main element identifies primary content; tabindex="-1" allows the target to receive focus without adding it to the normal Tab sequence. Test with a keyboard and keep the link visible when focused.
<a href="#main">Skip to main content</a><nav aria-label="Primary"> <a href="index.html">Home</a></nav><main id="main" tabindex="-1"> <h1>Course overview</h1> <p>Choose a lesson to begin.</p></main>The skip link targets main content rather than forcing users through the menu.
Practice and next steps
Build a primary navigation and an on-page contents navigation with distinct labels. Add a skip link to the main content.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Navigation: Semantic Menus and Skip Links — Knowledge Check
Check the core concepts from this lesson.
Which element identifies a major navigation block?
Which attribute identifies the current page in a set of links?
Where should a skip link appear to bypass a repeated menu?
A page has primary and footer navigation. How can users distinguish the landmarks?
Which markup expresses a collection of navigation links within nav?