Atrybut flex-wrap w CSS

Definition and usage

The flex-wrap property specifies whether flexible items should wrap.

Note:The flex property is invalid if the element is not a flexible item.

See also:

CSS tutorial: CSS flexible box

CSS reference manual:flex property

CSS reference manual:flex-basis property

CSS reference manual:flex-direction property

CSS reference manual:flex-flow property

CSS reference manual:flex-grow property

CSS reference manual:flex-shrink property

HTML DOM reference manual:flexWrap property

Example

Make flexible items wrap when needed:

div {
  display: flex;   
  flex-wrap: wrap;
}

Try it yourself

CSS syntax

flex-wrap: nowrap|wrap|wrap-reverse|initial|inherit;

Attribute value

Value Description
nowrap Default value. Specifies that flexible items should not wrap.
wrap Specifies that flexible items should wrap when needed.
wrap-reverse Specifies that flexible items should wrap when needed in the reverse direction.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical details

Default value: nowrap
Inheritance: No
Animation creation: Not supported. See:Animation-related properties.
Version: CSS3
JavaScript syntax: object.style.flexWrap="nowrap"

Browser support

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

Numbers with -webkit- or -moz- prefixes indicate the first version using the prefix.

Chrome IE / Edge Firefox Safari Opera
29.0
21.0 -webkit-
11.0 28.0
18.0 -moz-
9.0
6.1 -webkit-
17.0