Center the alignments for all the items of the flexible <div> element:
The align-items 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.
| Default value: | stretch |
|---|---|
| Inherited: | no |
| Animatable: | no. Read about animatable |
| Version: | CSS3 |
| JavaScript syntax: | object.style.alignItems="center" Try it |
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by -webkit- specify the first version that worked with a prefix.
| Property | |||||
|---|---|---|---|---|---|
| align-items | 21.0 | 11.0 | 20.0 | 7.0 -webkit- | 12.1 |
| Value | Description | Play it |
|---|---|---|
| stretch | Default. Items are stretched to fit the container | Play it » |
| center | Items are positioned at the center of the container | Play it » |
| flex-start | Items are positioned at the beginning of the container | Play it » |
| flex-end | Items are positioned at the end of the container | Play it » |
| baseline | Items are positioned at the baseline of the container | Play it » |
| initial | Sets this property to its default value. Read about initial | Play it » |
| inherit | Inherits this property from its parent element. Read about inherit |
CSS Reference: align-content property
CSS Reference: align-self property
HTML DOM reference: alignItems property