Style flexWrapProperty
Examples
Make flexible items wrap when necessary:
document.getElementById("main".style.flexWrap="wrap";
Try it Yourself »
Definition and Usage
The flexWrap property specifies whether flexible items should wrap or not.
Note:If the element is not a flexible item, the flexWrap property has no effect.
Browser Support
![]()
Firefox, Opera, and Chrome support the flexWrap property.
Syntax
Return the flexWrap property:
object.style.flexWrap
Set the flexWrap property:
object.style.flexWrap="nowrap|wrap|wrap-reverse|initial|inherit"
Property Values
| Value | Description |
|---|---|
| nowrap | Default value. Specifies that flexible items will not wrap. |
| wrap | Specifies that flexible items will wrap when necessary. |
| wrap-reverse | Specifies that flexible items will wrap when necessary, but in reverse order. |
| initial | Sets this property to its default value. Seeinitial。 |
| inherit | Inherits this property from its parent element. Seeinherit。 |
Technical Details
| Default Value: | nowrap |
|---|---|
| Return Value: | A String, representing the flex-wrap property of an element. |
| CSS Version | CSS3 |
Related Articles
CSS Reference:flex-wrap Property
HTML DOM STYLE Reference:flex Property
HTML DOM STYLE Reference:flexBasis Property
HTML DOM STYLE Reference:flexDirection Property
HTML DOM STYLE Reference:flexFlow Property
HTML DOM STYLE Reference:flexGrow Property
HTML DOM STYLE Reference:flexShrink Property
Other Extensions
Style Object