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

Style alignItems Property

Style Object Reference Style Object

Example

Center the alignments for all the items of the flexible <div> element:

document.getElementById("myDIV").style.alignItems = "center";

Try it yourself »


Definition and Usage

The alignItems property specifies the default alignment for items inside the flexible container.

Tip: Use the align-self property of each item to override the align-items property.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The alignItems property is supported in IE11, Firefox, Opera and Chrome.

The alignItems property is not supported in Internet Explorer 10 and earlier versions, or Safari.


Syntax

Return the alignItems property:

object.style.alignItems

Set the alignItems property:

object.style.alignItems="stretch|center|flex-start|flex-end|baseline|initial|inherit"

Property Values

Value Description
stretch Default. Items are stretched to fit the container
center Items are positioned at the center of the container
flex-start Items are positioned at the beginning of the container
flex-end Items are positioned at the end of the container
baseline Items are positioned at the baseline of the container
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: stretch
Return Value: A String, representing the align-items property of an element
CSS Version CSS3


Related Pages

CSS reference: align-items property

HTML DOM STYLE Reference: alignContent 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