Barrierepruefung.de Web Accessibility Checker

No skip link to the main content

The finding means none of the first links on the page jumps to a target on the same page. Either the skip link is missing, it comes too late in the document, or its target does not exist. Put a link at the very top of the body whose anchor points to the id of the main content.

Last reviewed: Sources

The message

Identifier
own.missing-skip-link
Type of check
automatic
Severity
moderate
Success criterion
Meaning
No link was found that skips repeated blocks.
Impact
Keyboard and screen reader users must traverse the entire navigation on every page.
Fix
Make a link to the main content the first focusable element.

How does your website stand?

The free check shows what can be measured automatically, with the location. No account.

Check website for free

What the rule checks

The rule reads the structure of the loaded page as it stands after its scripts have run (the DOM) and looks at its first links, in the order in which they appear in the document. One of them has to point to an anchor on the same page, an href such as #content, and an element with exactly that id has to exist. A bare # does not count.

It only reports a finding when the page has enough links for a skip to be worthwhile. The finding also says whether a main region is present.

What the rule does not check: whether the link becomes visible on focus, and whether focus actually moves when it is activated. That remains a manual check. Conversely, it only looks for a skip link. The criterion accepts other ways as well, such as landmarks and headings, which are described on the page about WCAG 2.4.1.

Common causes

  • There is none. The theme or site builder does not ship a skip link.
  • Too far down. The skip link only comes at the end of the header, after the logo, language switcher, contact links or a cookie notice whose links sit before it in the document.
  • Target without a matching id. The link points to #main, but the main content is <main id="content">, or the target only carries a name attribute.
  • Not a real anchor. The jump is built with a <button>, href="#" or href="javascript:…" and a script.
  • Full address instead of an anchor. The link reads /page#content or carries the whole URL. The rule only recognises an href that starts with #.

How to fix it

Make the skip link the first element in the body, before the header and the cookie notice, and give the main content the matching id:

<body>
  <a class="skip-link" href="#content">Skip to main content</a>

  <header>…</header>
  <nav aria-label="Main menu">…</nav>

  <main id="content" tabindex="-1">
    <h1>…</h1>
  </main>
</body>

tabindex="-1" on the target makes sure focus follows the jump, so the next Tab press continues in the content rather than back in the menu.

The link may be hidden as long as it appears when it receives focus:

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: #ffffff;
  color: #1a1a1a;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

If a script inserts the cookie notice at the very top of the body, the skip link moves down. If the notice is a dialog that receives focus when it opens, it can just as well sit at the end of the document.