Intern Track Roadmap

CSS flexbox: direction

This course covers how flexbox items flow and how they are sized. It starts with flex-direction and how the main and cross axes swap when items run in a column. It then covers flex-wrap for items that run out of room, and align-content for spacing wrapped lines. Next come flex-grow, flex-shrink and flex-basis, along with the flex shorthand. The order property reorders items visually, with an accessibility trade-off. A final lesson builds a responsive pricing card row with no media query.

What you'll learn

  • ✓How flex-direction rotates the main and cross axes
  • ✓Wrapping items onto new lines with flex-wrap and flex-flow
  • ✓Spacing wrapped lines with align-content
  • ✓Growing and shrinking items with flex-grow, flex-shrink and flex-basis
  • ✓Reading the flex shorthand values 1, auto, none and initial
  • ✓Reordering items with order and its accessibility trade-off
Free preview · Lesson 1 3 min read

flex-direction: row, column, and the axis swap

The last course built a navbar and a centered modal, but every example kept the main axis in its default direction: horizontal, left to right. That default was only a starting point. flex-direction is the property that turns it.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...