Easy Tutorial
❮ Prop Style Marginbottom Met Canvas Addcolorstop ❯

alignItems Property

Style Object

Example

Center align the items of a flexible <div> element:


Definition and Usage

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

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


Browser Support

IE11, Firefox, Chrome, and Opera support the alignItems property.

Safari, IE 9 and earlier versions do not support the alignItems property. IE 10 requires the prefix MS.

Syntax

Return the alignItems property:

Set the alignItems property:

Property Values

Value Description
stretch Default value. Items are stretched to fit the container.
center Items are centered within the container.
flex-start Items are aligned at the start of the container.
flex-end Items are aligned at the end of the container.
baseline Items are aligned at the baseline of the container.
initial Sets this property to its default value. See initial
inherit Inherits this property from its parent element. See inherit

Technical Details

Default value: stretch
Return value: String, representing the align-items property of an element.
--- ---
CSS version CSS3
--- ---

Related Articles

CSS Reference: align-items Property

HTML DOM STYLE Reference: alignContent Property

HTML DOM STYLE Reference: alignSelf Property


Style Object

❮ Prop Style Marginbottom Met Canvas Addcolorstop ❯