Code has been added to clipboard!

The CSS Flex-Direction Property

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

Understanding CSS flex direction

The CSS flex-direction property allows you to modify item placement in the flex container:

Example
div {
    display: -webkit-flex; /* Safari */
    -webkit-flex-direction: column-reverse; /* Safari 6.1 and newer */
    display: flex;
    flex-direction: column-reverse;   
}

Syntax requirements

The syntax for CSS flex-direction is simple, as you only need to define one out of four available values:

flex-direction: value;

You can see the choice of values in the table below.

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

CSS flex-direction property values

Value Description
row The default value. Items form a row along the flex container's main axis
row-reverse Items form a row along the flex container's main axis, but the direction is reversed
column Items form a column along the flex container's block axis
column-reverse Items form a column along the flex container's block axis, but the direction is reversed

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: 25/01/2021
3176 People Used
Only 97 Left
Rating
5.0