CSS Order Property (original) (raw)

Last Updated : 10 Jan, 2025

The order property defines the arrangement of flexible items inside a flex container, determining their position relative to one another. It allows you to visually reorder items without affecting their order in the source code.

**Syntax

**order: number | initial | inherit;

**Property values:

Item 1
Item 2

`

1. Using Number property

The number value in the order property specifies the position of a flexible item relative to others in a flex container.

**Syntax:

**order: number;

HTML `

Item 1
Item 2
Item 3

`

**In this example

**2. Using initial Value

The initial value resets the order property to its default value, which is 0.

**Syntax:

order:initial;

HTML `

Item 1
Item 2
Item 3

`

**In this example

3. Using inherit Value

The inherit value makes the order property inherit its value from its parent element.

HTML `

Item 1
Item 2
Item 3

`

**In this example

Best Practices for Using CSS order Property