From the course: Responsive Layout

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Direction

Direction - HTML Tutorial

From the course: Responsive Layout

Start my 1-month free trial

Direction

- [Instructor] When you do layout with Flexbox, the default layout as you saw in the previous video is a row of flex items going from left to right. But you can also go right to left or top to bottom or bottom to top, and that's what we'll look at in this video. The flex-direction property establishes the direction of the main axis. The main axis is where most of the action is happening in Flexbox. The default is horizontal, going from left to right. The cross axis is always the direction perpendicular to the main axis. What you see is the default positions of the main and cross axes. The default main axis is horizontal, going in the direction of text. So for most of you, that is left to right. If you are working with a language like Arabic where the text goes right to left, and you've set the text direction on the page as right to left, then the default for Flexbox is right to left. Everything horizontal in Flexbox will be the opposite direction of what I'm showing you in this video.…

Contents