Easy Tutorial
❮ Jsref Infinity Jsref Getfullyear ❯

alignContent Property

Style Object

Example

Align the items of a flexible <div> element:


Definition and Usage

The alignContent property aligns the items within a flexible container vertically when the items do not occupy all available space on the cross axis.

Tip: Use the justifyContent property to align items on the main axis (horizontally).

Note: The container must have multiple lines of items for this property to have an effect.


Browser Support

Chrome and Opera support the alignContent property.


Syntax

Return the alignContent property:

Set the alignContent 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 beginning of the container.
flex-end Items are aligned at the end of the container.
space-between Items are evenly distributed with spaces between the lines.
space-around Items are evenly distributed with spaces before, between, and after the lines.
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-content property of the element.
--- ---
CSS version CSS3
--- ---

Related Articles

CSS Reference: align-content Property

HTML DOM STYLE Reference: alignItems Property

HTML DOM STYLE Reference: alignSelf Property

HTML DOM STYLE Reference: justifyContent Property


Style Object

❮ Jsref Infinity Jsref Getfullyear ❯