博客列表 >弹性盒子之弹性元素知识总结1--php培训第九期线上班
弹性盒子之弹性元素知识总结1--php培训第九期线上班
![涤尘](https://img.php.cn/upload/avatar/000/499/069/5db955f3b1fbc554.jpg)
- 涤尘原创转载
- 2019年11月05日 15:55:271492浏览
![](https://img.php.cn/upload/image/659/950/849/1572939620774543.jpg)
![](https://img.php.cn/upload/image/298/879/998/1572939863513822.jpg)
![](https://img.php.cn/upload/image/588/581/980/1572939883779809.jpg)
![](https://img.php.cn/upload/image/242/878/328/1572939893339064.jpg)
![](https://img.php.cn/upload/image/894/244/538/1572939907894632.jpg)
![](https://img.php.cn/upload/image/129/561/594/1572939915487914.jpg)
![](https://img.php.cn/upload/image/877/698/672/1572939924522506.jpg)
![](https://img.php.cn/upload/image/791/500/337/1572939932800478.jpg)
![](https://img.php.cn/upload/image/629/294/368/1572939942655262.jpg)
![](https://img.php.cn/upload/image/915/945/961/1572939951305206.jpg)
![](https://img.php.cn/upload/image/171/759/294/1572939964854489.jpg)
![](https://img.php.cn/upload/image/386/918/692/1572939972487331.jpg)
![](https://img.php.cn/upload/image/491/111/815/1572939981269745.jpg)
![](https://img.php.cn/upload/image/589/881/423/1572939989416283.jpg)
![](https://img.php.cn/upload/image/706/187/413/1572939998413997.jpg)
![](https://img.php.cn/upload/image/652/171/559/1572940007256857.jpg)
![](https://img.php.cn/upload/image/435/951/371/1572940016868592.jpg)
![](https://img.php.cn/upload/image/340/909/102/1572940024892968.jpg)
![](https://img.php.cn/upload/image/975/709/737/1572940070961281.jpg)
![](https://img.php.cn/upload/image/533/721/632/1572940082521684.jpg)
![](https://img.php.cn/upload/image/948/835/568/1572940091179667.jpg)
总结:弹性盒子用来布局,相较以往布局方式更加灵活,代码量少,适配PC端和移动端,理解主轴与垂直轴定义!任何元素都可以变成弹性容器,进而设置出需要的效果,这个很强大!
以下弹性容器常用属性应牢记
序号 |
属性 |
取值 |
描述 |
1 |
flex-direction |
row(默认), row-reverse, columne, column-reverse |
弹性元素在主轴上排列方向 |
2 |
flex-wrap |
norap(默认), wrap, wrap-reverse |
弹性元素在主轴上是否换行 |
3 |
flex-flow |
flex-direction, flex-wrap |
定义主轴方向以及弹性元素是否换行,flex-direction 和flex-wrap 简写 |
4 |
justify-content |
flex-start(默认值),flex-end,center,space-between,space-around,space-evenly |
弹性元素在垂直轴上的对齐方式与空间分布 |
5 |
align-items |
stretch(默认),flex-start,flex-end,center |
定义弹性元素在垂直轴上的对齐方式 |
6 |
align-content |
stretch(默认),flex-start,flex-end,center,space-between,space-around,space-evenly |
定义多行容器中弹性元素在垂直轴上的对齐方式与空间分配 |
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。