
1、align-items中的items指的是flex 中的子项,因此align-items指的就是flex子项们相对于flex容器在垂直方向上的对齐方式。
2、适用于所有的flex容器,单行时候垂直居中使用align-items: center。
实例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <style>
.first{
width : 300px ;
height : 300px ;
border : 1px solid blueviolet;
}
.first div{
width : 30px ;
height : 30px ;
}
</style>
</head>
<body>
<div>
<div style= "background-color: khaki;" >AA</div>
<div style= "background-color: lawngreen;" >BB</div>
<div style= "background-color: lightcoral;" >CC</div>
</div>
</body>
|
以上就是css中align-items属性的介绍,希望对大家有所帮助。更多css学习指路:css教程
本文教程操作环境:windows7系统、css3版,DELL G3电脑。