Last week, Marieke McCloskey posted a web accessibility article on the Neilsen-Norman Group site: “Keyboard-Only Navigation for Improved Accessibility.” The article is very good; I wanted to make some general comments on it. The article had several points, which I will comment on in brief:
- Test using the site with keyboard. This is good advice, because often you cannot find some usability issues unless you actually try something yourself.
- Make sure that the keyboard focus is visually obvious. This is important because otherwise people who are using the keyboard (perhaps because they cannot physically use a mouse) cannot tell what they are doing. Browsers often have a visible highlight, but oftentimes the styling is overridden by web site designers who want a particular look and feel. I find myself irritated by this problem from time to time (when I don’t feel like switching from the keyboard to the mouse) when I cannot tell where tabbing went. Do not override the highlight unless you provide a highlight that is at least as obvious as the default when interactive elements are focused.
- Make sure all interactive elements are navigable. If an element is not navigable, then the person will not be able to tab to or otherwise focus on the element in order to interact with it. The element just sits there, taunting them. Native HTML elements are navigable by default, but scripted interactive elements based on generic HTML elements (such as a span or div) should have a tabindex or some other mechanism to make them navigable.
- Consider a link to skip navigation. Sites with navigation links and sidebars may have many things through which a user must tab before they can get to the main content of the site. While it is important for the person to be able to get to the navigation, it is very inefficient to have to tab through material that is on most pages. The article suggests using “Skip Navigation” links on a page. I would like to make a few additional comments on this suggestion below.
Alternative to Skip Links
The Web Content Accessibility Guidelines 2.0 (WCAG) are accessibility guidelines for web sites (and they also provide good guidance for documents and software). Guideline 2.4.1 from WCAG says:
2.4.1 A mechanism is available to bypass blocks of content that are repeated on multiple Web pages. (Level A)
Skip links are one way to do this, but are kind of old fashioned. They clutter up a page and clutter up the navigation order. A better technique that has pretty good support with modern browsers and screen readers is to use landmark roles which add semantics to a web page.
Landmark roles were introduced with Accessible Rich Internet Applications (ARIA). To use ARIA landmark roles:
- Ensure that the page has all information in containing sections. These sections might be
<div>s or HTML 5 section tags such as:
- Make sure there is only one
- Add the
roleattribute to each containing section and an attribute value from the list of ARIA landmark roles and other useful roles.
article (non-landmark role)
- Make sure that the containing section tag matches a similar landmark role. ARIA has greater richness than HTML 5 does. So you would have sections like:
and potentially a number of
<section>s with other landmark roles.
A screen reader user can navigate from landmark to landmark on a web page. This allows them to more easily navigate a page and go back and forth to the content in which they are interested.
- Using WAI-ARIA Landmarks – 2013 by Steve Faulkner of the Paciello Group.
- Using ARIA landmarks to identify regions of a page technique from WCAG 2.0.