Style alignSelf 属性
定义和用法
alignSelf 属性规定灵活容器内被选中项目的对齐方式。
注意:alignSelf 属性可重写灵活容器的 alignItems 属性。
浏览器支持





Firefox、Opera 和 Chrome 支持 alignSelf 属性。
语法
返回 alignSelf 属性:
	object.style.alignSelf
设置 alignSelf 属性:
	object.style.alignSelf="auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
属性值
| 值 | 描述 | 
|---|---|
| auto | 默认值。元素继承了它的父容器的 align-items 属性。如果没有父容器则为 "stretch"。 | 
| stretch | 元素被拉伸以适应容器。 | 
| center | 元素位于容器的中心。 | 
| flex-start | 元素位于容器的开头。 | 
| flex-end | 元素位于容器的结尾。 | 
| baseline | 元素位于容器的基线上。 | 
| initial | 设置该属性为它的默认值。请参阅 initial。 | 
| inherit | 从父元素继承该属性。请参阅 inherit。 | 
技术细节
| 默认值: | auto | 
|---|---|
| 返回值: | 字符串,表示元素的 align-self 属性。 | 
| CSS 版本 | CSS3 | 
相关文章
CSS 参考手册:align-self 属性
HTML DOM STYLE 参考手册:alignContent 属性
HTML DOM STYLE 参考手册:alignItems 属性
 Style 对象
 Style 对象