X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Style justifyContent Property

Style Object Reference Style Object

Example

Make some space between the items of the flexible <div> element:

document.getElementById("main".style.justifyContent="space-between";

Try it yourself »


Definition and Usage

The justifyContent property aligns the flexible container's items when the items do not use all available space on the main-axis (horizontally).

Tip: Use the alignContent property to align the items on the cross-axis (vertically).


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The justify-content property is supported in Firefox, Opera, and Chrome.


Syntax

Return the justifyContent property:

object.style.justifyContent

Set the justifyContent property:

object.style.justifyContent="flex-start|flex-end|center|space-between|space-around|initial|inherit"

Property Values

Value Description
flex-start Default value. Items are positioned at the beginning of the container
flex-end Items are positioned at the end of the container
center Items are positioned at the center of the container
space-between Items are positioned with space between the lines
space-around Items are positioned with space before, between, and after the lines
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: flex-start
Return Value: A String, representing the justify-content property of an element
CSS Version CSS3


Related Pages

CSS reference: justify-content property

HTML DOM STYLE Reference: alignContent property

HTML DOM STYLE Reference: alignItems property

HTML DOM STYLE Reference: alignSelf property


Style Object Reference Style Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook