Dear WCAG Plus Forum members,
We continue our journey through the Operable Principle of WCAG 2.1, which is about making content usable for all. Today, we're tackling Guideline 2.4 Navigable, a concept that focuses on a fundamental aspect of every website: helping users find their way, locate what they're looking for, and always know where they are.
A good website is like a clear map: it never makes you feel lost. This guideline pushes us to design interfaces that make navigation an efficient and frustration-free experience.
Success Criterion 2.4.1 Bypass Blocks (Level A)
A mechanism is available to bypass blocks of content that are repeated on multiple web pages.
The problem: Repetitive Navigation
Imagine using your website with only a keyboard, by pressing the
Code: Select all
Tab
For a screen reader user, it's even more frustrating: the screen reader is forced to read aloud all of these repetitive elements on every single page before reaching the content. This waste of time and effort is a significant barrier to usability. Criterion 2.4.1 exists to eliminate this obstacle.
The solution: The Skip Link
The most common and universal mechanism to meet this criterion is the "skip to main content" or "skip link."
- * What Is It? It's a link that is visually hidden (so it doesn't clutter the design for users navigating with a mouse), which becomes visible and focusable only when a user navigates with a keyboard (or another non-visual interface).
* How Does It Work? When a user presses thekey upon entering the page, the first element that receives focus is this "Skip to main content" link. If they activate it (by pressingCode: Select all
Tab
), the keyboard focus is moved directly to the start of the page's main content, thus bypassing all the repetitive blocks.Code: Select all
Enter
The mechanism is surprisingly simple to implement with HTML and CSS:
1. Add a link at the very beginning of the page, before all the repetitive elements:
Code: Select all
<a href="#main-content" class="skip-link">Skip to main content</a>
Code: Select all
<main>
Code: Select all
<div>
Code: Select all
<main id="main-content">
</main>
Code: Select all
.skip-link {
position: absolute;
left: -999px;
...other styles to make it visible on focus...
}
- * Keyboard-only users: They can navigate from one page to another incredibly faster, saving hundreds of keystrokes.
* Screen reader users: They no longer have to listen to every single navigation link being read aloud on every single page.
* Anyone looking for efficiency: Even experienced mouse users can benefit from this link if they activate it out of habit.
Have you ever found a "skip link" useful on a site you were using? Or have you ever thought about how much time is lost without one? Share your experiences!