Fix guides · Accessibility
How to add a skip link and a main landmark
Keyboard and screen reader users have to wade through your whole header on every page unless they can jump straight to the content. How to add a working skip link and <main> region.
- Time to fix
- 15–30 minutes
- Skill needed
- Copy and paste
- Who notices
- Keyboard and screen reader users
Why it matters
Every page repeats the same logo, menu and icons. A sighted mouse user skips them with a glance; a keyboard user may have to press Tab dozens of times to reach the content.
A <main> element marks where the content starts, so screen reader users can jump to it. A "Skip to content" link at the very top does the same for keyboard users. Both need to point at something that exists.
“One out of every ten "skip" links were broken—either they were hidden in a way that made them inaccessible or the link target was not present in the page.”
Before you start
- Wrap each page's main content in a single <main> element.
- Make the skip link the first focusable element, pointing at an id on <main>. It can be hidden until it receives focus, but not with display: none.
Fix it on your platform
Shopify
- Shopify's theme accessibility guidance asks themes for a skip link that's visible when focused, with tabindex="-1" on the main content container.
- Most current themes include one. If yours doesn't, add it to layout/theme.liquid and give the <main> element a matching id.
<a class="skip-to-content-link" href="#MainContent">Skip to content</a>
…
<main id="MainContent" tabindex="-1">
{{ content_for_layout }}
</main>WordPress
- Block themes add a skip link automatically when the template has a main area. Make sure your template's main Group block uses the <main> HTML element (Advanced → HTML element).
- Themes tagged accessibility-ready must include a skip link. Older themes without one: switch, or add it to header.php.
Webflow
- Select your main content wrapper, open the Settings panel, click the Tag dropdown and choose Main.
- Add a Link Block at the top of the page with the text "Skip to content", linking to the main wrapper's ID, and style it to appear on focus.
Wix Managed by the platform
- Wix turns on a "Skip to Main Content" link automatically; it appears when visitors press Tab. Keep your content in the page body rather than the header so the link lands on it.
Squarespace Managed by the platform
- Squarespace adds a "Skip to Content" link automatically; it appears when a visitor presses Tab. If it's flagged, contact Squarespace support.
Next.js
- Put <main> in your root layout around the page content, and a skip link before your header.
<body>
<a href="#main" className="skip-link">Skip to content</a>
<Header />
<main id="main" tabIndex={-1}>{children}</main>
</body>Any other site
- Add the link first in <body>, and show it on focus with CSS.
.skip-link {
position: absolute;
left: -9999px;
}
.skip-link:focus {
left: 1rem;
top: 1rem;
}Check that it's fixed
- Load the page and press Tab once: "Skip to content" should appear. Press Enter, then Tab: focus should land inside the main content.
- Re-run your StudioLNC audit: the issue should be gone.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.