Visual Order and Accessibility: order, reading-flow and Reversed Directions
Reordering flex items with order and reversed directions, why visual order and keyboard and screen reader order can disagree, the WCAG rules involved, the new reading-flow and reading-order properties, and safe ways to reorder.
kvi5hnuCode Sprout team member8 min readOn this page
Flexbox and grid can show items in a different order from the HTML: order, flex-direction: row-reverse or column-reverse, flex-wrap: wrap-reverse, and grid placement (Part 10) all do it. That's powerful, but CSS only moves the boxes. The keyboard focus order and the order screen readers read in still follow the HTML, so a reordered layout can be confusing, or unusable, for people who don't use a mouse or can't see the screen.
order
order sets a flex or grid item's position in the layout. Items are laid out in ascending order, and items with the same value keep their source order:
.card .image { order: -1; } /* before everything with the default order: 0 */
.card .meta { order: 2; } /* after everything with order 0 or 1 */
- The initial value is
0; negative values are allowed. - It only applies to flex and grid items; on other elements it has no effect.
- It changes painting order too: items are painted in their
ordersequence, which matters when they overlap.
Tested in Chrome: four links with order values 2, −1, 0 and 0 are laid out with the −1 first, then the two 0s in source order, then the 2.

Item 1 is first in the HTML but last on screen, and that HTML position is still what Tab and screen readers use.
Reversed directions
flex-direction: row-reverse and column-reverse place items from the end, and flex-wrap: wrap-reverse stacks lines the other way (article 61). They're reorderings too: in row-reverse, the first item in the HTML is on the right.
The problem: two orders
There are now two orders:
- the visual order, what sighted mouse users see;
- the source order, the DOM, which drives
Tabfocus order, screen readers, reader modes, search engines, copying text, and what's shown without CSS.
When they disagree, keyboard users see focus jump around the screen, and screen reader users hear content in an order that doesn't match what someone sighted would describe. Tested in Chrome: in a row of three links where the third has order: -1, pressing Tab focuses them as a, b, c, the HTML order, even though c is shown first.
Two WCAG success criteria apply:
- 1.3.2 Meaningful Sequence (level A): when the order of content affects its meaning, that order must be available to assistive technology, which means it must be right in the DOM.
- 2.4.3 Focus Order (level A): focus must move in an order that preserves meaning and operability.
Reordering that doesn't change meaning is fine: a decorative image moved before a heading, or a sidebar shown on the left while it comes after the main content in the HTML. Reordering interactive elements, or content whose sequence matters, like steps or a form, is what causes failures.
reading-flow and reading-order
reading-flow, set on a flex or grid container (or, with source-order, on a block container), makes the reading order follow the layout instead of the HTML. In Chrome, that changes both the Tab order and the order in which the accessibility tree exposes the items, so screen readers follow it too. It's new: Chrome 137 only, so far.
| Value | Focus order follows |
|---|---|
normal (initial) | the source order, as before |
flex-visual | the visual order of flex items, as read in the writing mode: left to right in English, whatever order or flex-direction did |
flex-flow | the flex flow direction: for row-reverse, from the right |
grid-rows, grid-columns | grid items row by row, or column by column (article 68) |
grid-order | grid items by order, ignoring placement |
source-order | the source order, but lets reading-order override it |
Tested in Chrome 157, pressing Tab through a container with links a, b, c, where b has order: 2 and c has order: -1, and a row-reverse container with d, e, f:
reading-flow | First container | row-reverse container |
|---|---|---|
normal | a b c | d e f |
flex-visual | c a b | f e d |
flex-flow | c a b | d e f |
flex-visual matches what an English reader sees, left to right. flex-flow follows the direction items are laid out in, so in row-reverse it starts at the right.

The badges are the measured sequences from the table above: only the top-left container makes focus jump back and forth.
reading-order is an integer on an item, used when the container has reading-flow: source-order (or another value other than normal): items are visited in ascending reading-order, then in their place in the flow. Tested in Chrome: with reading-flow: source-order, a first link with reading-order: 1 is focused after its sibling with the default 0.
.toolbar { display: flex; flex-direction: row-reverse; reading-flow: flex-visual; }
.steps { display: grid; reading-flow: grid-rows; }
Things to know:
- It applies to the container's direct children (and the children of
display: contentschildren), not to deeper descendants. - Browsers without it, and anything else that reads the DOM (reader modes, copied text, search engines), still use the source order, so it must stay sensible.
- In browsers without support, the declaration is ignored and the order stays the source order, so it's a safe progressive enhancement.
Reordering safely
- Get the source order right first. Write the HTML in the order that makes sense when read aloud. That's the order with no CSS, and for most users.
- Reorder with CSS only for visual adjustments that don't change meaning: moving an image above the text in a card, swapping a sidebar to the other side on wide screens.
- Don't reorder focusable elements unless you use
reading-flow, and even then keep the source order sensible for browsers without it and for screen readers. - Test with the keyboard. Press
Tabthrough the page and watch where focus goes. If it jumps backwards across the screen, fix the HTML. - Don't use
row-reversefor right-to-left languages. Usedir="rtl", and the normalrowdirection follows it automatically (article 47).
body { font: 0.85rem system-ui, sans-serif; margin: 1rem; }
.steps { display: flex; gap: 0.5rem; margin: 0.75rem 0; flex-wrap: wrap; }
.steps a {
padding: 0.5rem 0.75rem; border-radius: 6px;
background: #f4efe6; border: 1px solid #8a3b12; color: #2b2118; text-decoration: none;
}
.steps a:nth-child(1) { order: 3; } /* shown last */
.steps a:nth-child(3) { order: -1; } /* shown first */
.steps a:focus-visible { outline: 3px solid #2f7d4f; outline-offset: 2px; background: #dff0e5; }
body:has(#flow:checked) .steps { reading-flow: flex-visual; }
The steps are shown as 3, 2, 1, but without reading-flow the Tab key visits them as 1, 2, 3, jumping right to left. With the checkbox on, in Chrome, focus moves left to right, matching the screen. Both are confusing here, because the steps have a meaning in sequence: the real fix is to put them in the right order in the HTML.
What's current
order, reversed directions andwrap-reversework in all browsers.reading-flowandreading-order: Chrome 137, not yet in Firefox or Safari.- Grid's
reading-flowvalues (grid-rows,grid-columns,grid-order) are covered with grid placement in article 68.
Common questions
Does order change the tab order?
No. Focus and screen readers follow the HTML. Only reading-flow, in Chrome, makes focus and the accessibility tree follow the layout.
When is reordering with CSS acceptable? When the new order doesn't change meaning, and doesn't make focus jump around confusingly. Moving decorative or non-interactive content is usually fine.
Should I use tabindex to fix the focus order?
No. Positive tabindex values create an order that's separate from both the layout and the DOM, and are very hard to maintain. Fix the HTML, or use reading-flow.
Can I use row-reverse for right-to-left languages?
Don't. Set dir="rtl" on the page; row already follows the writing direction.
Summary
orderand reversed directions change the visual order of flex and grid items, not the DOM order.- Keyboard focus, screen readers and everything else without CSS follow the DOM order.
- WCAG 1.3.2 and 2.4.3 require a meaningful reading order and focus order.
reading-flow(Chrome 137+) makes focus follow the visual order or the flex flow;reading-orderadjusts single items.- Put content in a sensible order in the HTML, and reorder with CSS only when meaning doesn't change.
Practice questions
In which order are these items laid out?
<div style="display: flex">
<div style="order: 1">A</div>
<div>B</div>
<div style="order: -2">C</div>
<div style="order: 1">D</div>
</div>
Answer
C, B, A, D. C has the lowest order, then B with 0, then A and D with 1, in their source order.
A product card's HTML is: title, price, image. The design shows the image first, using order: -1. Is this an accessibility problem?
Answer
Usually not: the image isn't interactive, and reading the title before the image doesn't change the meaning. It would be a problem if the moved item were a link or button, or if the sequence mattered.
A toolbar has flex-direction: row-reverse, so its buttons appear in the opposite order from the HTML. What does reading-flow: flex-visual change, and where?
Answer
In Chrome 137 and later, Tab moves through the buttons in the order they're shown, left to right, instead of the HTML order. Other browsers ignore it and keep the HTML order.
Why is flex-direction: row-reverse the wrong way to support an Arabic version of a page?
Answer
dir="rtl" makes row start at the right automatically, and also flips text, logical properties and everything else. row-reverse in a right-to-left page would put items back in left-to-right order.
Previous: Alignment in Flexbox: justify-content, align-items, gap and auto Margins
Next: Flexbox in Practice: Navigation Bars, Media Objects, Sticky Footers and Forms

More in CSS Course
Quiz: CSS Delicate Details
Twenty-five questions on the edge cases that surprise experienced developers: invalid custom properties, shorthands that reset values, layer order with !important, containing blocks, margin collapsing, specificity of :is() and :where(), intrinsic minimum sizes, and more, each checked in Chrome.
Quiz: CSS Interview Questions
Thirty front-end interview questions: cascade, specificity and layers, box model and margin collapsing, stacking contexts, positioning, flexbox and grid, responsive design, custom properties, performance, accessibility, modern selectors and architecture.
Quiz: CSS Course Final Exam
Thirty questions across the whole CSS course: syntax and error handling, selectors, the cascade and layers, values and units, color, the box model, backgrounds, positioning, flexbox, grid, responsive design, typography, generated content, effects, transforms, motion and architecture.
Quiz: CSS Architecture, Tooling and Debugging (CSS Part 17)
Twenty questions on modular CSS and BEM, layering a stylesheet, design tokens and theming, pattern libraries and safe refactoring, preprocessors and build tools, the at-rules reference, and debugging common CSS problems.
Discussion
Sign in to ask a question or share what you learned.