How can I check whether my page’s tab order follows its visual structure?
Quick answer
Use the page with only a keyboard: start at the top, press Tab repeatedly, and record each focused control in order. Compare that sequence with what the layout and content suggest a person should encounter next. The orders need not match exactly if the sequence remains understandable and usable. If they diverge confusingly, check the DOM order first; rearranging elements there is generally a more robust correction than forcing a new tab sequence with tabindex. [S1] [S2]
The question, the details, the next step.
A practical checklist
Choose a page task and write down the meaningful sequence of controls needed to complete it.
Navigate from the start using Tab; record each focused control by its label or purpose.
Use Shift+Tab to check whether the reverse sequence remains understandable.
Compare the observed order with content relationships and layout; note confusing jumps, not harmless differences in screen position.
If the mismatch is disruptive, inspect DOM order and consider a structural change rather than forcing a sequence with tabindex.
Repeat the keyboard review after changes and record remaining concerns.
A few more useful answers
Does keyboard focus have to follow the exact left-to-right, top-to-bottom visual order?
No. The sequence can differ from the visual layout if it remains understandable and operable. The key question is whether it preserves meaning and makes sense for the task. [S1]
If the tab order feels wrong, should I add tabindex values to rearrange it?
Does a sensible tab sequence prove the page’s reading order is also correct?
No. A tab-only review does not verify the complete reading experience. The WAI-ARIA Authoring Practices Guide recommends keeping tab order and screen-reader reading order logical and aligned. [S2]
Sources
References used for this guide.
- [S1] W3C Understanding WCAG 2.2: Focus Order w3.org · Checked
- [S2] W3C ARIA APG: Developing a Keyboard Interface w3.org · Checked
