Skip links are internal navigation links that let keyboard and screen reader users bypass the elements at the top of a page and land directly on the main content. They are usually hidden from view, which is why many people have never seen one; on CSS-Tricks itself, opening DevTools will reveal the site's own skip link.
The implementation pattern favored here keeps the link in the document at all times and only reveals it when it receives focus: position it absolutely, transform it off-screen, then bring it back and style it on :focus.
Multiple links for long pages
A single skip link to the content is only the starting point. Pages that rely on AJAX to load more posts as the user reaches the bottom can be especially hard to escape for keyboard users, making the footer difficult to reach. A second link that jumps straight to a #footer element solves that case. The markup gains another anchor, and the CSS switches from :focus to :focus-within, so the whole group is shown whenever anything inside the .skip-link element has focus. Neither Internet Explorer nor Opera Mini support :focus-within, but coverage is otherwise strong and a polyfill is available. The footer needs an id for the link to target.
Why it matters
The case for skip links rests on time: letting users jump to the part of a site they care about saves it. A reader who arrived via a direct link to an article may have no interest in the navigation at all, yet a keyboard user has to tab through every navigation item before reaching the content. In the sample site used for the walkthrough, there are eight navigation items to get past. While a skip link is not a fix for every accessibility problem, it addresses this one and produces a more polished experience. Amazon, Chase, Google (a link to leave accessibility feedback rather than a skip link), Target, The New York Times and Zillow all employ this or a similar technique.
The walkthrough builds on a small sample site with just a home page and a blog page, enough to show the behavior. If two skip links are present, styling each one differently makes it clearer that they are separate controls than leaving both as plain white buttons.



