Centerly align an item within the flex object element:
#myBluep
##{
align-self:center;
}
手册网(www.shouce.ren) 红色蓝色带有更多内容的绿色 div注意: align-self 属性重写了容器的 align-items 属性。
注意: Internet Explorer 10 及更早版本浏览器不支持 align-items 属性。
注意: Safari 7.0 及更新版本通过 -webkit-align-items 属性支持该属性。
align-self attribute defines the alignment of flex items individually in the direction of the cross axis (vertical axis). .
Note:The align-self attribute can override the align-items attribute of the flexible container.
21.0 | 11.0 | 20.0 | 9.0 | 7.0 -webkit- | 12.1
align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;
Default: | auto |
---|---|
No | |
No. Please refer to | CSS3 animation properties, CSS3 animation examples. |
CSS3 | |
object. style.alignSelf="center" Effect preview |
Value | Description | Test |
---|---|---|
##auto | default value. The element inherits the align-items property of its parent container. "stretch" if there is no parent container. | Effect preview |
##stretch | The element is stretched to fit the container. | Effect Preview |
center## The | # element is located in the center of the container. | Effect preview |
##flex-startThe | element is located at the beginning of the container. | Effect preview |
The | element is located at the end of the container.Effect preview | |
## The# element is located at the baseline of the container. | Effect Preview | |
##initial | Set this property to its default value. See initial. | Effect preview |
##inherit | Inherit this attribute from the parent element. See inherit. |