- Level
- A
- Since
- WCAG 2.0
- Entries
- 77 / 193
2.4.1 Bypass Blocks
A keyboard user needs a way past the repeated header and navigation to the content.
/ What it requires
Most pages open with the same header, logo, search box and navigation. A mouse user looks past them. A keyboard user has to press Tab through every link in that block on every page before reaching the content, and a screen reader user hears it read out again each time. For people who type with a head pointer, a switch or one hand, those extra key presses on every page are a real cost in time and effort.
The criterion asks for a mechanism to bypass blocks that are repeated across pages, and does not prescribe which one. W3C lists several sufficient techniques: a skip link at the top of the page that moves to the main content, headings at the start of each section, landmark regions such as main and nav, and titled frames. A skip link that is hidden until it receives focus passes. One that points to a missing target does not do the job.
/ How pages fail it
- There is no skip link, no main landmark and no heading at the start of the content, so the only route is Tab through the whole header.
- The skip link points to an id that does not exist on the page, so activating it does nothing.
- The skip link is hidden with display: none, which removes it from the keyboard order as well as from view.
- A script intercepts the skip link to animate the scroll and leaves focus in the header, so the next Tab lands back in the navigation.
- An iframe has no title, so a screen reader user cannot tell what the frame holds or whether to skip it.
/ How to check it yourself
- Load the page, click in the address bar and press Tab once. A link such as Skip to content should appear as the first stop or one of the first.
- Press Enter on it, then press Tab again. Focus should move to the first control inside the main content, not back into the navigation.
- In the DevTools Elements panel, check that the href of the link matches the id of an element that exists, and that the page has one main element.
- With a free screen reader such as NVDA, press D to jump between landmarks and H to jump between headings, and confirm the main content can be reached that way.
- Check every iframe for a title attribute that names its content.
/ How to fix it
- Add <a href="#main">Skip to content</a> as the first focusable element in body, and give the content wrapper id="main".
- Mark up the regions with header, nav, main and footer elements, with exactly one main per page.
- Move the skip link off screen with a visually hidden class and bring it into view on :focus. Do not use display: none or visibility: hidden.
- If focus does not land on the target in your test, add tabindex="-1" to the target element.
- Give every iframe a title attribute that describes what is inside.
/ What our scanner checks
Four checks map here. no-skip-link reports a page that has a main landmark, more than ten tab stops before it and no skip link among the first six. An HTML_CodeSniffer rule reports same-page links whose target id does not exist, and another reports iframes without a title, as does the axe-core rule frame-title. None of them follows the skip link to see where focus lands.
/ Who fails it, in our own measurements
One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.
/ Questions about this criterion
Is a skip link required by WCAG?
Not by name. 2.4.1 requires a mechanism to bypass repeated blocks, and W3C accepts landmarks or a heading structure as sufficient techniques too. A skip link is still worth adding, because browsers offer no built-in keyboard command for jumping between landmarks or headings, so sighted keyboard users without a screen reader depend on it.
Can the skip link be hidden?
Yes, as long as it becomes visible when it receives keyboard focus and stays in the tab order. Position it off screen and bring it back on :focus. A link hidden with display: none or visibility: hidden cannot be focused at all, and one that stays invisible while focused leaves sighted keyboard users guessing where they are.
Why does my skip link not move focus?
The usual causes are an href that points to an id missing from the page, a click handler that calls preventDefault to animate the scroll, or a target the browser does not treat as the starting point for the next Tab. Fix the id, drop the handler or move focus inside it, and add tabindex="-1" to the target.
