Content · Web Development · HTML

HTML Skip Links and Keyboard Focus Targets

Skip Links and Keyboard Focus Targets: Try moving through the elements with a keyboard. The labels and relationships matter even when no extra styling has been added. Includes a practical HTML example and an explanation.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

A webpage should make sense even when someone cannot see its colors, pictures, or layout.

What You Need to Know


Put a skip link before the repeated navigation and point it to the main content. It should become easy to notice when reached by keyboard, not remain permanently invisible to the person using it.

Try the Example


Take a look at the example. We’ll explain the important lines right below it.

<a href="#main-content">Skip to main content</a>
<nav aria-label="Main navigation"><a href="/home">Home</a></nav>
<main id="main-content" tabindex="-1">
    <h1>Welcome to our lessons</h1>
    <p>Begin reading here.</p>
</main>

Let’s Read the Code


  • <nav>: Navigation elements identify groups of important links.
  • <main>: The main element marks the primary page content.
  • href: Href is the URL to a related resource or destination.
  • aria-label: Aria-label supplies an accessible name when a visible one is not available.

Read the named elements and attributes together. They explain how the browser connects this feature to the rest of the page.

What Happens in the Browser?


Try this with Tab and Shift+Tab. If you can, inspect the accessibility tree too; appearance alone does not tell the whole story.

What does assistive technology receive? The example includes aria-label. These relationships can explain names, states, or descriptions when used correctly. They do not automatically move focus, listen for clicks, or create keyboard handling.

Your Turn


Move through the example without a mouse. Read each control name and current state aloud as if describing it to a friend.

Common Beginner Mistakes


  • Judging the page only by how it looks, without checking its meaning and keyboard behavior.
  • ARIA changes what assistive technology is told; it does not automatically add keyboard controls, visual styling, or JavaScript behavior.

Key Takeaways


  • Put a skip link before the repeated navigation and point it to the main content.
  • <nav>: Navigation elements identify groups of important links.
  • A meaningful HTML element is usually a stronger starting point than adding an ARIA role to a generic div. Also check what happens using only the keyboard.
Share this resourceSend this page to someone who may find it useful.