CSS
Flexbox: Visually Reordering Items with `order`
Learn how to visually reorder flex items independently of their source HTML order using the CSS `order` property for dynamic layouts and accessibility improvements.
.container {
display: flex;
}
.item-1 { order: 2; }
.item-2 { order: 3; }
.item-3 { order: 1; }
How it works: The `order` property allows you to change the visual order of flex items within a flex container, overriding their default source order. Lower `order` values appear first. Items with the same `order` value are ordered by their source order. This is useful for responsive design where element arrangement needs to shift.