当前位置:网站首页>Detailed explanation of flex attributes in flex layout
Detailed explanation of flex attributes in flex layout
2022-06-25 04:24:00 【Robin Luo Bing】
One 、 theory
display:flex
Container attribute :flex-direction,flex-wrap,flex-flow,justify-content,align-items,align-content
Project properties :order,flex-grow,flex-shrink,flex-basis,flex,align-self
Where the flex yes flex-grow, flex-shrink and flex-basis Abbreviation
flex-grow Values are 0,1( Define project magnification ): 0 Indicates that the item is not enlarged when its width is less than the width of the container ,1 Indicates that when the item width is smaller than the container width, it is enlarged , The default is 0
flex-shrink Values are 0,1( Define project downsizing ): 0 Indicates that when the item width is greater than the container width, it breaks through the container width ,1 Indicates that when the item width is larger than the container, the container width will not be exceeded , The default is 1
flex-basis The value method can be percentage , It can also be px, Such as 50%,100px
among flex-grow And flex-shrink The value of is only 0,1. If it is any other value, I seem to be useless during the test , The corresponding multiples are not shown , The test environment is chome browser
Two 、 give an example
<style>
.parent{
width: 200px;
height: 150px;
background-color: black;
display: flex;
flex-flow: row wrap;
align-content: flex-start;
}
.chirld{
box-sizing: border-box;
background-color: white;
flex: 0 1 280px;
height: 50px;
border: 1px solid red;
}
</style>
<div class="parent">
<div class="chirld">hello</div>
<div class="chirld">hello</div>
<div class="chirld">hello</div>
<div class="chirld">hello</div>
<div class="chirld">hello</div>
</div>
flex: 0 1 280px
The third parameter indicates... In the project 280px Greater than in the container 200px, Of the second parameter 0 And 1 Settings work ; If the third parameter is less than 200px, Of the first parameter 0 And 1 Settings work
The third parameter is equivalent to whether the first and second parameters work .
google It makes me feel the same as baidu A different experience . Searching for technical information is even better :
1、Flex Layout of the tutorial : Grammatical passage http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html
2、Flex Layout of the tutorial : Case study http://www.ruanyifeng.com/blog/2015/07/flex-examples.html
3、CSS flex Attribute in-depth understanding https://www.zhangxinxu.com/wordpress/2019/12/css-flex-deep/
4、 Elastic layout (display:flex;) Properties, https://segmentfault.com/a/1190000018233450
5、 illustration :CSS Flex Attributes are not difficult at all https://wcc723.github.io/css/2017/07/21/css-flex/
边栏推荐
- Cesium 加载显示热力图
- kenlm
- Development of trading system (III) - risk control system
- numpy np tips:使用opencv对数组插值放缩到固定形状 cv2.resize(res, dsize=(64, 64), interpolation=cv2.INTER_CUBIC)
- AI quantitative transaction (II) -- tushare financial data framework
- PHP code audit 1 - php Ini
- 【LeetCode】22. 括号生成
- 智慧风电:数字孪生 3D 风机智能设备运维
- 【LeetCode】22. bracket-generating
- Development of trading system (IX) -- dark pool technology
猜你喜欢
1280_ C language to find the average value of two unsigned integer
地方/园区产业规划之 “ 如何进行产业定位 ”
Text keyword extraction: ansj
Development of trading system (III) - risk control system
UCLA | 用于黑盒优化的生成式预训练
"How to carry out industrial positioning" in local / Park industrial planning
文本关键词提取:ansj
Turn 2D photos into 3D models to see NVIDIA's new AI "magic"!
地方/園區產業規劃之 “ 如何進行產業定比特 ”
5 key indicators of SEO: ranking + traffic + session + length of stay + bounce rate
随机推荐
Coinlist how to operate the middle lot number security tutorial
AI quantitative transaction (II) -- tushare financial data framework
[team learning] SQL programming language notes - task04
Laravel document sorting 9. Blade template
LeetCode 剑指Offer II 091 粉刷房子[动态规划] HERODING的LeetCode之路
LeetCode 劍指Offer II 091 粉刷房子[動態規劃] HERODING的LeetCode之路
Development of trading system (VII) -- Analysis of trading delay
Flutter Builder & FutureBuilder组件
Monitoring pancakeswap new token
@RequestBody解决获取参数为null
Lecture record: history and development of strapdown inertial navigation solution
DAP数据调度功能完善说明
client-go gin的简单整合十一-Delete
Laravel document sorting 8. Middleware
Numpy NP tips: squeeze and other processing of numpy arrays
Hello CTP (IV) - CTP transaction API
论文阅读《LSD-SLAM: Large-Scale Direct Monocular SLAM》
“语法糖”——我的编程新知
numpy np tips: numpy数组的squeeze等处理
【openwrt】推荐一个国内开发的openwrt的版本,iStoreOS简介,非常好用,主要是做了一些优化。解决了汉化的问题。