Lab 6
Reading Order
Reading order versus visual order (WCAG 1.3.2)
Move the cards. Then find out whether a screen reader, and the Tab key, moved with them.
Before you start
CSS can put anything anywhere. A screen reader does not look at where things are. It reads the HTML in the order it is written, and the Tab key visits controls in that same order. When a layout rearranges things with CSS, sighted readers see one sequence and everyone else gets another.
Below are six numbered steps in a grid. Each card has a label showing where it is seen and where it is read. Move them with the arrow buttons, with the arrow keys while a card has focus, or by dragging. Start in "Move with CSS" and watch the read positions refuse to follow.
The lab
The panel under the grid lists the cards in the order they are read. Press Tab through the cards to feel the same thing: focus follows that list, not the screen. The Tab Walk lab draws that path as numbered stops over a whole page.
What you just learned
- Two orders, one of them invisible. The visual order is where things are. The DOM order is where they are in the HTML. Screen readers, the Tab key, reader modes, search snippets, and copy-and-paste all use the DOM order.
- CSS
orderis the usual culprit. So areflex-direction: row-reverse, explicit grid placement, and absolute positioning. All of them move the pixels and leave the reading order where it was. - The fix is to change the DOM. If a card should come first, put it first in the HTML. In "Move the DOM" mode every move does that, and the read positions follow instantly.
- The exception is content whose order does not matter. A row of equal cards can be reordered visually without harm. Numbered steps, headings, form fields, and navigation cannot.
- Tab is the quick test. If focus jumps backward or sideways as you press Tab, the two orders disagree. You do not need a screen reader to find this bug.
The field note Reading order is not visual order covers the CSS cases in detail, and corpus page 18-reading-order plants two of them for an agent to find.
Embed this lab
Host the Reading Order lab on your own page with one element and one script. It runs entirely in the visitor's browser, sends nothing back, and adds a small credit link.
<div data-a11y-world-lab="reading-order"></div>
<script src="https://a11y.world/embed.js" async></script>
Related notes
-
Reading order is not visual order
CSS can put anything anywhere. Screen readers and the Tab key follow the DOM, not the layout. When the two disagree, the page tells two different stories.
-
Tab order is a promise the DOM makes
The Tab key follows the HTML, not the layout. CSS cannot change that order, a positive tabindex hijacks it, and aria-hidden does not remove a stop. One real walk found 162 stops where a list of the markup said 64. Here is why, and how to check.
-
The sticky header that eats your focus
Shift+Tab back up a form and the field you land on slides under the sticky header. The browser scrolled just far enough, and just far enough is behind the bar. WCAG 2.2 calls it focus not obscured. One CSS property fixes it.
-
Twenty-four pixels is a smaller promise than it sounds
WCAG 2.2 asks for pointer targets of 24 by 24 CSS pixels. The spacing exception means a row of 18 px icons can pass and a row of 24 px icons can be hard to hit. Here is the rule, the circle, and the five exceptions, drawn.
-
When the toolbar will not fit
Five icons, a narrow bar, and a 24 px rule that cannot be met as laid out. Adding height does not fix it. Wrapping does. An equal split of the width can leave every icon one pixel short. Here is the order to try fixes in, and when to stop.
-
400 percent zoom is a layout test, not an edge case
Zoom a desktop page to 400 percent and you get a 320 pixel wide viewport. If the page cannot reflow into that, it has failed for everyone who needs large text.
-
The empty alt is a choice
alt="" tells a screen reader to skip the image on purpose. A missing alt tells it to read the file name. They look similar in the source and could not be more different to a reader.
Seen a layout that does this in the wild?
Tell us where. Real examples become field notes and corpus pages.
Send an example