CSS flex-direction property

The flex-direction property specifies the direction and axis of the flex items (children elements) inside a flexible container or flexbox.

Syntax

flex-direction: row|row-reverse|column|column-reverse|initial|inherit;

Default value: row

svg viewer

Implementation

We make the container a Flexbox by setting display: flex. We then use flex-direction: column to set the axis to be vertical.

Try experimenting with different values like row, row-reverse, and column-reverse for flex-direction.

  • HTML
  • CSS (SCSS)
Copyright ©2024 Educative, Inc. All rights reserved