Style flexWrap Property

Example

Make the flexible items wrap if necesarry:

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

Description

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

Property
flexWrap Yes 11.0 Yes 9.0 Yes

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


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.