hub.eb?material_id=499&track_id=503

Skip Links


Skip links jump to other parts of the page and should be the first interactive elements to enable users with assistive techologies to jump straight to the content they're interested in.

Skip links are simply Hyperlink Controls pointing to a control on the page with a specified Id.

It's common practice to hide skip links from view until they have the focus (i.e. until someone tabs to them). This way the aesthetic of the page is unaffected but keyboard-only users can still use the links.

Using display:none or visibility:hidden also hides elements from screen readers, so to hide a skip link some CSS trickery is required. For example:

.skip-link {
  clip-path: inset(100%);
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link:focus, .skip-link:active{
  clip: auto;
  height: auto;
  overflow: visible;
  position: static;
  white-space: normal;
  width: auto;
}

Bootstrap provides screen reader visibilty classes sr-only and sr-only-focusable to achieve the same effect.

While it isn't necessary to use skip links if you're using Landmark Containers, it can help your users to navigate more efficiently.

If your page doesn't use Landmark Containers or skip links, your page will fail an accessibility audit.

Steps


1

Create a form and add a Hyperlink Control with the text Skip to Interesting Content.

Add two Panel Controls.

Add a Text Control to the first panel with the text Boring Content and a Text Control to the second panel with the text Interesting Content.

2

This technique is about assistive techonologies but in order to visually demonstrate it we'll shift the target panel off the bottom of the page.

Set the height of the first panel to 3000px.

3

Set the Id of the second panel to myPanel.

Check the Hyperlink Control's Link is external property and set the External URL to #myPanel.  

4

Create a CSS Web Resource called skipLink.css and add the CSS snippet from above.

Attach the CSS Web Resource to your form.

Add the skip-link class to the Hyperlink Control.

5

Run the form and press Tab to focus to the hyperlink and show it.

Press Enter to jump to the interesting content.

Current Module

Related