弹性盒子布局常用属性

display : flex 声明当前容器时弹性容器 (默认从左到右子元素水平排列)

flex-direction : row 从左到右排列 (主轴水平)

flex-direction : row-reverse 从右到左排列 (主轴水平)

flex-direction : column 从上到下排列 (主轴垂直)

flex-direction  : column-reverse 从下到上排列 (主轴垂直)

flex-wrap : nowrap 不换行

flex-wrap : wrap 换行

flex-wrap : warp-reverse 从下到上(第一行在下方)

justify-content : flex-start 左对齐

justify-content : flex-end 右对齐

justify-content : center 居中

justify-content : space-between 平均分开

justify-content : space-around 两边有空格

order 整数,越小越靠前,默认为0

align-items : flex-end 垂直

flex-grow : 扩张因子,默认为0

flex-shrink : 收缩因子,默认为1

align-self: auto|stretch|center|flex-start|flex-end|baseline|initial|inherit;

align-self: flex-end 元素位于容器的结尾。

较详细算法参考

参考 https://www.jianshu.com/p/8c2f384576af

 

posted @ 2021-08-19 20:43  从入门到入土  阅读(196)  评论(0编辑  收藏  举报