Why does a skip-to-content link not work?

A skip-to-content link fails when its fragment does not match a unique target ID, the target cannot receive focus reliably or script cancels the browser’s default anchor behavior. Scrolling alone is not enough if keyboard focus remains in the header. The next Tab press may otherwise return the user to the navigation they intended to bypass.
Check the markup first. The href value and target id must match exactly, IDs must be unique, and the target must exist when the link is activated. In a single-page application, confirm that routing or re-rendering does not remove the target before focus moves.
Use a focusable main target when browser behavior requires it:
<a href="#main-content" class="skip-link">Skip to main content</a>
<main id="main-content" tabindex="-1">
<h1>Search results</h1>
</main>
Then inspect CSS. The link may remain clipped or behind another layer when focused, and the destination may scroll beneath a sticky header. Use an appropriate stacking level for the link and add scroll offset to the target or container. Avoid JavaScript that calls preventDefault() unless the script also performs correct scrolling and focus management.
Test with Tab, Enter and the next Tab press, not by clicking the link. Confirm that the link becomes visible, the viewport moves, focus reaches the main region and subsequent navigation continues inside it. Verify the browser history and URL fragment behavior as well, particularly when client-side routing intercepts hash links or restores scroll position. The feature works only when both the visual position and the keyboard interaction point leave the repeated block.