Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Keyboard accessibility is one of the most important aspects of web accessibility. Not all users navigate the page with the mouse or a trackpad; some users only rely on keyboard to navigate. Many users with motor disabilities rely on a keyboard. Assistive technology users will also typically use a keyboard for navigation. In addition to traditional keyboards, some users may use a modified keyboards or other hardware that mimics the functionality of a keyboard.

Keyboard tab order allows keyboard users to properly navigate a web page. If tab order is implemented correctly a webpage will read similar to a book to a keyboard user. When done incorrectly a keyboard user may miss out or become confused with the order of the web page.

Tab order is important for proper navigation through a keyboard interface. The keyboard tab order must be coordinated with the structure of the webpage. The default keyboard navigation order must be logical and intuitive. The tab order should follow the visual flow of the page: left to right, top to bottom – header first, then main navigation, then page navigation (if present), and finally the footer.

To adjust the tab order, the following methods can be applied using the tabindex attribute:

  • tabindex= "0" allows elements besides links and form elements to receive keyboard focus. It does not change the tab order, but places the element in the logical navigation flow, as if it were a link on the page.

  • tabindex= "-1" removes the element from the navigation sequence, but can be made focusable using javascript. 

A tabindex= “1” or higher should NOT be used as it is a bad practice when it comes to accessibility because:

  1. Normal flow in the keyboard tab order will be broken when tabbing through the interactive elements.

  2. If content is dynamically added in between of elements with positive tabindex, it will interfere with the normal flow of tabbing.

General Guidelines

The best practices for keyboard tab order should include the following:      

  • Tab order should have a logical reading order, similar to a book. It should be from left to right and top to bottom.

  • As you are tabbing through a website, there must be a visible indication of where the tab focus is at.

  • When using the tabindex to adjust the tab order, use tabindex= "0" or tabindex= "-1" ONLY

  • Tabindex values of 1 or higher must NOT be used.

Example

The image below  shows the correct reading order on a page that has multiple navigation links on the side panels.