一、flex-direction: (元素排列方向)
※ flex-direction:row (横向从左到右排列==左对齐)
※ flex-direction:row-reverse (与row 相反)
※ flex-direction:column (从上往下排列==顶对齐)
※ flex-direction:column-reverse (与column 相反)
二、flex-wrap: (内容一行容不下的时候才有效)
※flex-wrap:nowrap (超出不换行,很奇怪里面的宽度会变成100%)
※ flex-wrap:wrap (超出按父级的高度平分)
※flex-wrap:wrap-reverse(与wrap 相反)
三、justify-content: (水平对齐方式)
※flex-start (水平左对齐)
※ justify-content:flex-end; (水平右对齐)
※ justify-content:center;(水平居中对齐)
※justify-content:space-between; (两端对齐)
※justify-content:space-around; (两端间距对其)
四、align-items: (垂直对齐方式)
※ align-items:stretch; (默认)
※align-items:flex-start; (上对齐,和默认差不多)
※align-items:flex-end; (下对齐)
※ align-items:center;(居中对齐)
=※align-items:baseline; (基线对齐)
如弹性盒子元素的行内轴与侧轴(纵轴)为同一条,则该值与'flex-start'等效。其它情况下,该值将参与基线对齐。
flex容器属性
flex项目属性
到此这篇关于css3 flex实现div内容水平垂直居中的几种方法的文章就介绍到这了,更多相关css3div水平垂直居中内容请搜索以前的文章或继续浏览下面的相关文章,希望大家以后多多支持!