HTML & CSS / Editorial solution guide
A keyboard skip link is missing or does not reach content
Trace the link target, focusability, and visible focus before repairing a page’s bypass path.
Read-only knowledge base · No public comments
Recognize the symptoms
Keyboard users must tab through repeated navigation on every page, cannot see the skip link, or activate it without reaching the intended content. The link may exist in source while being hidden from focus or pointing to the wrong id. Reproduce from a fresh page load without a pointer.
Understand the likely causes
- The link may be removed from keyboard interaction by display:none, its fragment may not match a unique target, or a fixed header may obscure the destination. Focus behavior can also differ across browser environments.
Inspect the link and destination
Check that the skip link is near the start of the document and that its href fragment matches one unique id on the main content. Inspect whether the link is in the sequential keyboard order and whether its focused style is visible. The sample uses a native main region and a matching fragment. Its illustrative navigation path should be replaced with a real application destination.
Restore a visible focus path
Keep the link focusable even when it is visually positioned off screen, and bring it into view on focus with sufficient contrast. Do not use display:none for a control that must receive keyboard focus. A tabindex of -1 on the target permits programmatic focus without adding a normal Tab stop; verify the actual fragment navigation and focus behavior in supported browsers. Avoid adding a redundant or conflicting role to native main.
<a class="skip-link" href="#main-content">Skip to main content</a>
<nav aria-label="Primary"><a href="/courses">Courses</a></nav>
<main id="main-content" tabindex="-1">
<h1>Course overview</h1>
<p>Choose a lesson to begin.</p>
</main>
The fragment matches the main id, and the main region can receive programmatic focus.
Check layout and reading order
A fixed header can cover the focused link or destination. Adjust positioning, stacking, or scroll spacing according to the layout and test at zoom and narrow widths. Keep the target at the start of the meaningful content and ensure the next interactive element follows a sensible keyboard order. Test both writing directions if the site supports them, and inspect the accessibility tree for the landmark and link name.
Verify the complete interaction
Reload the page, press Tab until the link appears, activate it, and check both focus and viewport position. Continue tabbing and confirm navigation resumes in the intended content. Repeat with a narrow viewport, enlarged text, and supported browser combinations. Automated checks can identify some missing relationships, but manual keyboard review is needed to observe visibility, clipping, and actual navigation behavior.
Verify the fix
From a fresh load, verify the link is visible on focus, activates with the keyboard, and reaches the intended main region. Check that a fixed header does not obscure it.
Keep it from recurring
- Keep a skip-link keyboard check in page-template review and verify target IDs, focus visibility, and reading order after layout changes.