flex-wrap

CSS flexbox offers users powerful alignment options. A flex container groups multiple flex items together in order to control their representation.

Among the many properties offered by the flex container, one of the most widely used properties is flex-wrap.

svg viewer

The flex-wrap property defines whether the flex items are forced into a single line or wrapped into multiple lines in case of an overflow. This property accepts three values:

  • nowrap - all flex items are aligned in a single line. This may cause the container to overflow.

Flex items may also shrink in size to avoid container overflow.

  • wrap: flex items are aligned in multiple lines in case of overflow.
  • wrap-reverse: flex items are aligned in multiple lines in case of overflow but i​n the reverse direction of flex-direction.
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved