Skip to main content

What does the order property do?

order sets the display order of flex items inside the container, without changing their order in the HTML.

Behavior:

css
.item1 { order: 1; } .item2 { order: 5; } .item3 { order: 0; } /* the default value */

An element with a smaller order will come earlier, one with a larger value later. By default everything has order: 0, so elements follow their normal order.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.

What does the order property do?: CSS Interview Question