CSSCSS22 min read

CSS Flex Wrap

Understand how flex items wrap to new lines on small screens and why this is important for responsive design.

David Miller
December 3, 2025
6.6k178
  Flex-wrap allows items to move to next line.
  
  ## Without wrap
  Items shrink or overflow.
  
  ## With wrap
  ```css
  .container {
    display: flex;
    flex-wrap: wrap;
  }
  ```
  
  ## UI Visualization
  - Items go to next line on small screens
  
  ## Real-world example
  - Product cards
  - Image galleries
  
  ## Important
  Wrap is essential for responsive design.
  
#CSS#Beginner