Code has been added to clipboard!

The CSS Order Property

Reading time 1 min
Published Aug 8, 2017
Updated Oct 15, 2019

CSS flex: order of the items

The CSS order property defines the position of a specific flex item in the order of flex items in the same container:

Example
/* Code for Safari 6.1 to 8.0 */
div#Red {-webkit-order: 2;}  	
div#Blue {-webkit-order: 4;}
div#Green {-webkit-order: 3;}  	
div#Pink {-webkit-order: 1;}
/* Standard syntax */  	
div#Red {order: 2;}
div#Blue {order: 4;}
div#Green {order: 3;}
div#Pink {order: 1;}

By default, the order of displayed items depends on their order in the source document. Using CSS order, you can manipulate it as you wish.

Note: CSS order only works on flex containers.

Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid certificates of completion
Coursera
Pros
  • Professional service
  • Flexible timetables
  • A variety of features to choose from
Main Features
  • Professional certificates of completion
  • University-level courses
  • Multiple Online degree programs
Datacamp
Pros
  • Great user experience
  • Offers quality content
  • Very transparent with their pricing
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable

The syntax for CSS order

To syntax for this property is very straightforward – you just need to define the item's place in your preferred order:

order: value;

The default value for CSS flex order is 0. You can use any unitless number, including negative values.

Browser support

Browser image
Chrome
29+
Browser image
Edge
12+
Browser image
Firefox
20+
Browser image
IE
11+
Browser image
Opera
12.1+
Browser image
Safari
9+

Mobile browser support

Browser image
Chrome
29+
Browser image
Firefox
20+
Browser image
Opera
12.1+
Browser image
Safari
9+

Latest Udacity Coupon Found:

Verified STAFF PICK

75% OFF COURSES

Udacity Black Friday Offer

The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!

Expiration date: 19/01/2021
3176 People Used
Only 97 Left
Rating
5.0