display:flex 添加在伸缩容器(父元素的)
flex-direction: 伸缩布局方向 row 左向右 row-reverse 水平返向 column 上向下 column-reverse
flex-wrap:换行 nowrap不换行(默认值) wrap 换行(超出才换行,不超出不换行) wrap-reverse换行反向
当主轴方向是水平的 上下反向 当主轴方向垂直时 左右反向
justify-content:主轴的对齐方式(水平对齐方向) flex-start起点 flex-end 终点 center 居中 sapce-around 平均分,两端留白 space-between 平均分,两端不留白
align-items: 侧轴的对齐方向(单行的垂直对齐方式) flex-start起点 flex-end 终点 center 居中
align-self :(单个的垂直对齐) flex-start起点 flex-end 终点 center 居中
align-content:(多行的垂直对齐)必须和flex-wrap一起用 flex-start起点 flex-end 终点 center 居中 sapce-around 平均分,两端留白 space-between 平均分,两端不留白 stretch 拉伸(默认值)
order 顺序 值越大越靠后,可以取负值 默认为0
父元素:display:flex flex-direction flex-wrap justify-content align-items align-content
子元素的: order align-self flex
弹性盒模型布局(FLEX布局)
猜你喜欢
转载自blog.csdn.net/horizon12/article/details/108006405
今日推荐
周排行