CSSCSS22 min read

CSS Flex Direction

Learn how flex-direction controls row and column layouts and why vertical layouts become easy with Flexbox.

David Miller
December 12, 2025
3.2k115
  Flex direction controls **flow of items**.
  
  ## Direction values
  - row (default)
  - column
  
  ## Example
  ```css
  .container {
    display: flex;
    flex-direction: column;
  }
  ```
  
  ## UI Visualization
  - Items stack vertically
  - Like a column layout
  
  ## Real-world example
  - Sidebar menus
  - Mobile layouts
  
  ## Key understanding
  Direction changes main axis.
  
#CSS#Beginner