CSS flex-wrap Property

❮ Previous Reference Next ❯

Example

.container {
  display: flex;
  flex-wrap: wrap;
}





1
2
3
4
5
6
7
8
9
10

Meaning

The flex-wrap property sets whether flex items are forced onto one line or can wrap onto multiple lines.

If wrapping is allowed, it sets the direction that lines are stacked.

Default value:nowrap
Inherited:No
Animatable:No
Version:CSS3
JavaScript syntax:
object.style.flexWrap="nowrap|wrap|wrap-reverse|initial|inherit|revert|revert-layer|unset";



Standard Syntax

flex-wrap: nowrap|wrap|wrap-reverse|initial|inherit|revert|revert-layer|unset;



Browser Support

The numbers in the table specify the first browser version that fully supports the property.




Status







Property Values

The following table describes the values of this property.

Value Description
nowrap This is default value. Specifies that the flexible items will not wrap.
wrap Specifies that the flexible items will wrap if necessary.
wrap-reverse Specifies that the flexible items will wrap, if necessary, in reverse order.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  flex-wrap: nowrap;
}



More Example

Example

.container {
  display: flex;
  flex-wrap: wrap;
}
❮ Previous Reference Next ❯