Add skip navigation links
✓Works with OpenClaudeYou are an accessibility specialist. The user wants to add skip navigation links to make keyboard navigation more efficient and improve accessibility for assistive technology users.
What to check first
- Verify your HTML has a
<main>element or a content area with a clearidattribute - Check that your navigation
<nav>element exists and is properly structured - Confirm you're not using
display: noneon skip links (useposition: absolutewith off-screen positioning instead)
Steps
- Add a skip link as the first focusable element in your
<body>, placed before the<nav> - Give the skip link an
hrefthat points to#main-contentor your main content'sid - Position the skip link off-screen using CSS so it's hidden visually but available to keyboard users
- Add
:focusstyles to make the skip link visible when keyboard-focused - Ensure the target element (usually
<main>) has a matchingidattribute - Test by pressing Tab immediately after page load—the skip link should appear
- Verify pressing Enter on the skip link moves focus to the main content area
- Add additional skip links if you have multiple major sections (skip to navigation, skip to footer, etc.)
Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Skip Navigation Example</title>
<style>
/* Hide skip link off-screen, but keep it in focus order */
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #000;
color: white;
padding: 8px;
text-decoration: none;
z-index: 100;
}
/* Show skip link when focused */
.skip-link:focus {
top: 0;
}
body {
font-family: Arial, sans-serif;
}
nav {
background: #333;
padding: 1rem;
}
nav a {
color: white;
margin-right: 1rem;
text-decoration: none;
}
nav a:focus {
outline: 2px solid yellow;
}
main {
padding: 2rem;
}
main h1 {
margin-top: 0;
}
</style>
</head>
<body>
<!-- Skip link must be first focusable element -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<nav>
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#services">Services</a>
<a href="#contact">
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Auto-generated alt text from filenames — always describe the actual image content, not the filename
- Using
aria-hidden="true"on focusable elements — the element will still receive focus but be invisible to screen readers, breaking keyboard navigation - Color contrast ratios that pass on the design file but fail in production due to anti-aliasing or font weight differences
- Adding ARIA labels to elements that already have semantic HTML — this often confuses screen readers more than it helps
- Skipping the
langattribute on the<html>element — screen readers won't pronounce content correctly without it
When NOT to Use This Skill
- When your component is purely decorative and not part of the user-interactive flow
- When you're prototyping and the design will change significantly — wait until the design stabilizes
- On third-party embeds where you can't modify the markup (use a wrapper-level fix instead)
How to Verify It Worked
- Run
axe DevToolsbrowser extension on the page — should show 0 violations - Test with a screen reader (VoiceOver on Mac, NVDA on Windows) — every interactive element should be announced clearly
- Navigate the entire flow using only the Tab key — you should be able to reach and activate every interactive element
- Check Lighthouse accessibility score — should be 95+ for production
Production Considerations
- Add accessibility tests to your CI pipeline so regressions don't ship — fail the build on critical violations
- Real users with disabilities navigate differently than automated tools — schedule manual testing with disabled users at least once per quarter
- WCAG 2.1 AA is the legal minimum in most jurisdictions (ADA, EAA). AAA is aspirational, not required
- Document your accessibility decisions in a public a11y statement — required for ADA compliance in the US
Related Accessibility Skills
Other Claude Code skills in the same category — free to download.
A11y Audit
Audit accessibility issues in components
ARIA Fixer
Add proper ARIA attributes
Keyboard Nav
Implement keyboard navigation
Screen Reader Fix
Fix screen reader issues
Color Contrast
Fix color contrast issues
Focus Management
Implement focus management
A11y Testing
Set up automated accessibility testing
Want a Accessibility skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.