- 多列布局
- column-count:number/auto;分几列?
- column-width:auto/100px; 设置其列宽
column-gap: ; 设置间隙
column-rule-width/style/color: ; 设置列之间的分割线
弹性盒布局
-
改变元素的排练方式和布局
-
display:flex; 其属性为块级元素, 使子元素从左到右排列,其元素的浮动,清除浮动,vertical-align无效
-
display:inline-flex;其属性为行内块元素
-
容器上的属性(给父元素设置)
flex-direction:row;按从左到右的顺序一行排列
flex-direction:row-reverse;右》左 行
flex-direction:column;按从上到下的顺序一列排列
flex-direction:column-reverse;下》上 列 -
. justify-content:flex-start;左对齐
justify-content:flex-end;右对齐
justify-content:center;居中
justify-content:space-between;左右元素紧挨着边框各元素等距离对齐
justify-content:space-around;左右不挨边框的等距对齐方式 -
align-items:flex-start;靠上
align-items:flex-end;靠下
align-items:center;中间
align-items:baseline;文字基线对齐
align-stretch:将没有设置高度的子元素其高度与父元素一致
换行
flex-wrap:nowrap;不换行,项目缩小
flex-wrap:wrap;换行,第一行在上面
flex-wrap:wrap-reverse; 换行 ,第一行在下面
项目上的属性:给子元素设置
排序 order:0; 值越大,越靠后;值越小,越靠前;
占比 flex-grow:1; 分占其对应数值的剩余父元素空间
缩减 flex-shrink:1; 值越大缩减的越多