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.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved