The order property sets how a flex or grid item is sorted in the visual layout. Items are laid out by ascending order value. When values match, HTML source order decides the tie.
Set it on the item, not the container. The default is 0. It does not change the DOM, tab order, or what screen readers announce — only how boxes are painted.
Baseline · Widely available.
Not deprecated and not experimental. Use it for visual tweaks only. Do not use order to fix a wrong logical reading or focus order — change the HTML instead.
Syntax
CSS Syntax
syntax.css
order:<integer> | initial | inherit;
Example: order: -1; places that item before siblings still at 0.
Values
Property Values
Value
Description
Try it
<integer>
Ordinal group. Lower values come first. Default is 0
Bottom line: Safe for flex and grid in current browsers. Prefer sensible HTML source order for accessibility. This is not a JavaScript runtime API.
Remember
Key Takeaways
Role: sort flex or grid items by ascending integer for visual layout only.
Initial:0. Not inherited. Ties use source order.
Negative first:-1 appears before siblings still at 0.
Accessibility: fix the HTML when logical order must match what people see.
One line:order paints items by number — it does not rewrite the document’s reading or focus order.
Frequently Asked Questions
It sets the visual layout order of a flex or grid item. Items are sorted by ascending order value, then by HTML source order. It does not change the DOM, tab order, or screen-reader order.
The initial value is 0. Items with the same order value keep their source order relative to each other.
It applies to flex items and grid items. On a child whose parent is not a flex or grid container, order has no effect.
Yes. Lower values come first. A negative value such as -1 appears before items still at the default 0.
No. Tab order and assistive technology follow the HTML source. Prefer fixing the source order when the logical reading order must match what users see.
It is Baseline Widely available. Flex support includes Chrome 29+, Firefox 20+, Safari 9+, Edge 12+, and IE 10+. It is a browser layout property, not a Node.js feature.