How does the flex-wrap property affect the behavior of flex items when they overflow the container?

  • It adjusts the spacing between flex items.
  • It allows items to shrink to fit the container.
  • It allows items to wrap to the next line if they overflow.
  • It enforces a fixed height on the flex container.
The flex-wrap property in CSS determines whether flex items should wrap onto a new line when they overflow the container. Setting it to wrap allows items to move to the next line if they exceed the container width, while nowrap (default) prevents wrapping. This is crucial for responsive designs, especially when dealing with varying screen sizes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *