CSSCSS24 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
Dec 3, 2025
10.9k262
  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