flex常用的6个属性
1.flex-flow:控制主轴方向与是否换行
1.1:flex-flow:row wrap:允许主轴换行
//flex-flow:flex-direction flex-wrap
css:flex-flow:row wrap
![](https://img.php.cn/upload/image/144/765/324/1657702721378893.gif)
2 : place-content:容器中的剩余空间在项目之间如何进行分配
2.1 place-content:end:所有项目从右往左排列,剩余空间分到了左边
![](https://img.php.cn/upload/image/995/661/358/1657703185853510.png)
2.2 place-content:start:所有项目从左往右排列,剩余空间分到了右边
![](https://img.php.cn/upload/image/174/941/949/1657703269143364.png)
2.3 place-content:center:将所有剩余空间在所有项目左右二边平均分配
![](https://img.php.cn/upload/image/395/179/810/1657703422153483.png)
2.4 place-content:space-between:两端对齐
![](https://img.php.cn/upload/image/270/493/695/1657703562512316.png)
2.5 place-content:space-around:分散对齐
![](https://img.php.cn/upload/image/342/528/193/1657703636641086.png)
2.6 place-content:pace-evenly:平均对齐
![](https://img.php.cn/upload/image/141/964/204/1657703701591634.png)
3:place-items:项目在交叉轴上的对齐
3.1 place-items:stretch:自动伸展
![](https://img.php.cn/upload/image/241/737/542/1657704372669428.png)
3.2 place-items:start:上对齐
![](https://img.php.cn/upload/image/106/241/817/1657704596153626.png)
3.3 place-items:end:下对齐
![](https://img.php.cn/upload/image/535/330/218/1657704714586033.png)
4.flex:放大因子 收缩因子 计算宽度
4.1 flex:0 1 auto = flex:initial:(默认值)auto调用上面的width
![](https://img.php.cn/upload/image/793/251/664/1657705167349322.png)
4.2 flex:1 1 auto = flex:1 :(完全响应式)允许放大 允许缩小 宽度自动
![](https://img.php.cn/upload/image/558/585/343/1657782612358308.gif)
4.3 flex:none = flex:0 0 auto(pc布局):不能放大和缩小
![](https://img.php.cn/upload/image/399/832/739/1657788784737917.gif)
5.order:改动项目的顺序
5.1 order:2 :将选中的项目移到第二个位置后面(数字越小越靠前,支持负数)
![](https://img.php.cn/upload/image/757/809/164/1657789239381984.png)
6. place-self:控制某个项目的对齐方式
6.1 place-self:start:上对齐
![](https://img.php.cn/upload/image/364/281/719/1657789870697876.png)