Latest web development tutorials
 

Style flexWrap Property

< Style Object

Example

Make the flexible items wrap if necesarry:

document.getElementById("main".style.flexWrap = "wrap";
Try it Yourself »

Definition and Usage

The flexWrap property specifies whether the flexible items should wrap or not.

Note: If the elements are not flexible items, the flexWrap property has no effect.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The flexWrap property is supported in IE10+, Firefox, Opera, and Chrome.

Note: Safari 6.1+ supports an alternative, the WebkitFlexWrap 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 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. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: nowrap
Return Value: A String, representing the flex-wrap property of an element
CSS Version CSS3

Related Pages

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


< Style Object