Skip to content

Translated Web Content Accessibility Guidelines (WCAG) conformant, accessible yet invisible skip links.

Notifications You must be signed in to change notification settings

j15k/wcag-skip-links

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WCAG Skip Links

Translated Web Content Accessibility Guidelines (WCAG) conformant, accessible - yet invisible - skip links.


Table of contents


About

The Web Content Accessibility Guidelines (WCAG) are part of a series of web accessibility guidelines published by the Web Accessibility Initiative (WAI) of the World Wide Web Consortium (W3C), the main international standards organization for the Internet. The official recommendation for WCAG 2.1 was published in 2018 and was adopted by the European Union (EU) as the digital accessibility standard the same year.

Skip links are a mechanism to bypass blocks of content that are repeated on multiple Web pages (WCAG Success Criterion 2.4.1 Bypass Blocks).

Skip links help people, who navigate sequentially through content, to access the primary content of a Web page more directly. Skip links help to skip repeated blocks of content like logos and navigation links.

Usage

Create Skip links by following the instructions below.

HTML

  1. Place a HTML skip link on all of your Web pages, ideally before any other content. E.g.:
<body>
  <a href="#main-content" class="visually-hidden focusable skip-link">Skip to main content</a>
  1. Add id="main-content" attribute to an HTML element, that marks the beginning of the main content. E.g.:
<main id="main-content">

CSS

Add the following to your Cascading Style Sheets (CSS):

/* Hide visually but not from screen readers */

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  }

/* Allow the Skip link to be focusable when navigated to via the keyboard */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
  }

.skip-link.visually-hidden.focusable:focus {
  background: #ffffff;
  color: #000000;
  left: .2em;
  padding: .1em 2em;
  top: 0;
  width: auto;
  z-index: 99999;
  }

Link text

Set up translations. The translation table, international-skip-link_link-texts.csv, uses the ISO 639-1 and ISO 639-2/B language codes to identify ~28 languages. Help with translations is appreciated.

Example

You can inspect the example implementation by using the Tab key to navigate the rendered version of the example skip-link-example.html.

You can find the file itself on GitHub.

Documentation

Introduction to WCAG

Official documentation


Warranty and Liability

Responsive Images is a small, private project. The author makes absolutely no claims and representations to warranties regarding the accuracy or completeness of the information provided. However, you can use the information in this repository AT YOUR OWN RISK.

Licenses

Public Domain Mark
This work (WCAG skip links, by Jonas Jacek), identified by Jonas Jacek, is free of known copyright restrictions.

Contribute

Found a mistake? Open an issue or send a merge request. Want to help in another way? Contact me.

About

Translated Web Content Accessibility Guidelines (WCAG) conformant, accessible yet invisible skip links.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages