CSS align-items property

CSS Reference CSS Reference


Examples

Align the flexible pouch of the <div> element:

div
{
display: flex;
align-items:center;
}


Browser Support

Figures in the table represent the first browser to support the property version number.

Immediately following the digital -webkit-, -ms- or -moz- after the first version to support the prefix property.

Attributes
align-items 21.0 11.0 20.0 9.0
7.0 -webkit-
12.1

Definition and Usage

align-items property defines flex child on the current alignment of the container side of the shaft flex lines (vertical axis) direction.

Tip: Use each of the elastic elements of the object attributes align-self rewritable align-items property.

Defaults: stretch
inherit: no
Can be animated: no. Please refer to animation (Animatable) .
version: CSS3
JavaScript syntax: object .style.alignItems = "center"to try


CSS Syntax

align-items: stretch|center|flex-start|flex-end|baseline|initial|inherit;

Property Value

描述 测试
stretch 默认值。项目被拉伸以适应容器。 测试 »
center 项目位于容器的中心。 测试 »
flex-start 项目位于容器的开头。 测试 »
flex-end 项目位于容器的结尾。 测试 »
baseline 项目位于容器的基线上。 测试 »
initial 设置该属性为它的默认值。请参阅 initial 测试 »
inherit 从父元素继承该属性。请参阅 inherit


related articles

CSS Reference: align = left-Content attributes

CSS Reference: align = left-Self properties


CSS Reference CSS Reference