Giter VIP home page Giter VIP logo

wcag-skip-links's Introduction

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.

wcag-skip-links's People

Contributors

j15k avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.