Notes on building for the open web.
Home / Articles / Accessibility

Focus order is a design decision

Accessibility

Keyboard users experience a page in DOM order. Visual order and DOM order should agree. CSS can reorder elements on screen without changing the tab sequence, which silently breaks the experience for anyone not using a pointer.

Use landmarks and a skip link. A page with a header, navigation, main content, and a footer is easier to navigate than a wall of divs, and the skip link is the fastest route past repeated navigation.

Test with Tab, Shift+Tab, and Enter. Watch where the focus ring goes when a menu opens, a dialog appears, or content is removed. Focus that lands on a hidden element is a bug.

A focus ring is not decoration. It is the only cursor some users have. If the default ring is ugly, style it rather than removing it.