display:flex动态详解


采用Flex布局的元素,称为Flex容器(flex container),简称”容器”。它的所有子元素自动成为容器成员,称为Flex项目(flex item),简称”项目”。


没有display:flex的样式
1
2
3
原始 display:flex

主轴对齐

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-items:stretch

主轴方向|水平或/者垂直

flex-direction:row flex-direction:row-reverse flex-direction:column flex-direction:column-reverse

是否换行/及方向

flex-wrap:nowrap flex-wrap:wrap flex-wrap:wrap-reverse

放大比例

flex-grow:0 flex-grow:1 第二个元素flex-grow为2

缩小比例

flex-shrink:1 flex-shrink:0
Copyright © 2020-2023 春藤技术,春藤建站 All Rights Reserved
备案号:豫ICP备20020705号 公网安备 51LA统计
0.218374s