Building a Skip Link That Actually Works
Wire the anchor to a focusable target.
Building a Skip Link That Actually Works is a free Web Accessibility Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Web Accessibility Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Two Halves of a Skip Link
A working skip link has two parts: an anchor that links somewhere, and a target it can actually land on. Both must exist.
The Anchor Half
The anchor is a normal link whose href is a fragment, like a hash followed by an id. Clicking it tells the browser where to go.
<a href="#main">Skip to main content</a>The Target Half
The target is the element you want to reach. Give it a matching id so the fragment in the href has somewhere to point.
<main id="main"> ... </main>main Is the Natural Target
Point your skip link at the main landmark. It is the single region holding the unique content of the page, exactly where users want to land.
Clicking Is Not Enough
An old gotcha: the link scrolls the page, but focus stays on the link. The next Tab sends the user right back into the nav.
Make the Target Focusable
The fix is to let focus actually move there. Add tabindex equals minus one so the target can receive focus from the skip link.
<main id="main" tabindex="-1"> ... </main>Why Minus One, Not Zero
Minus one means scriptable and link-targetable, but not in the Tab order. The element will not become a stray tab stop for everyone else.
Modern Browsers Help
Today most browsers move focus to the fragment target automatically. But adding tabindex minus one guarantees it works everywhere, so keep it.
Test by Ear and Eye
Reload, press Tab once, then Enter. Your focus indicator should jump to the content, and the next Tab should continue inside it. ✅
Keep the Text Honest
Label it plainly. Skip to main content tells the user exactly what happens, far better than a vague Skip or an icon.
Order on the Page
Place the anchor as the first child of the body, before the header, so Tab reaches it before anything else on the page.
Quick Check
What lets focus actually land on the main region?
Recap
Wire an anchor to a matching id on main, add tabindex minus one, and test by tabbing. That is a skip link that truly works. 🎯
Frequently asked questions
Is the “Building a Skip Link That Actually Works” lesson free?
Yes — the full text of “Building a Skip Link That Actually Works” is free to read here on the web, and the Web Accessibility Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Web Accessibility Academy course, upgrade to CoddyKit PRO.
What will I learn in “Building a Skip Link That Actually Works”?
Wire the anchor to a focusable target. You practise Web Accessibility Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Web Accessibility Academy?
No prior experience is required. Web Accessibility Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Building a Skip Link That Actually Works” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Web Accessibility Academy lesson?
Yes. Every Web Accessibility Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why Skip to Main Content Exists
- Building a Skip Link That Actually Works
- Visually Hidden Until Focused
- Multiple Bypass Links for Big Pages