弹性盒布局:display:flex
弹性盒的影响:
1.子元素默认横向排列
2.行内元素变为块元素
3.当子元素只有一个元素时,使用margin:auto实现在屏幕内自动居中
修改主轴方向:flex-direction
取值:
1.row:行
2.column:列
3.row-reverse:反向行
4.column-reverse:反向列
修改主轴侧轴对其方式:
调整主轴对其方式:justify-content
取值:
1.flex-start
2.flex-end
3.center居中显示
4.space-between:两端对齐
5.space-around:距离对其
调整侧轴对其方式:align-items
取值:
1.flex-start
2.flex-end
3.center:居中显示