flex要点:
1.flex布局一定是在父及声明,然后传递给子及
居中:
flex-direction: row
- 水平布局,默认就有 不写也有
display:flex;
-
space-between
项目位于各行之间留有空白的容器内。 -
space-around
项目位于各行之前、之间、之后都留有空白的容器内。 -
justify-content: flex-end;
项目位于容器最右边 -
justify-content: flex-start;
项目位于容器最左边 -
justify-content: center;
项目位于容器中心
padding 设置元素所有内边距的宽度,或者设置各边上内边距的宽度。
注意: padding会让盒子变大,用 box-sizing: border-box; 控制这样盒子的宽度只会根据width来决定,padding不会撑大盒子