浏览器支持
官方定义align-items: stretch|center|flex-start|flex-end|baseline|initial|inherit;
默认值:
stretch
继承:
否
动画制作:
不支持。请参阅:动画相关属性。
版本:
CSS3
JavaScript 语法:
object.style.alignItems="center"
值
描述
stretch
默认。项目被拉伸以适合容器。
center
项目位于容器的中央。
flex-start
项目位于容器的开头。
flex-end
项目位于容器的末端。
baseline
项目被定位到容器的基线。
initial
将此属性设置为默认值。
inherit
从其父元素继承此属性。
实践应用
flex布局中的align-items,它可以设置flex-start/flex-end/center/baseline,前面三个比较容易理解,baseline是如何对齐的呢?
align-items: baseline;实际上是对内容进行一条线排列。
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.