当前位置:网站首页>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/
边栏推荐
- Watch out for the stolen face! So many risks of face recognition used every day?
- Is opencv open source?
- Cesium loading display thermal diagram
- Intel 13th generation core showed its true colors for the first time: 68mb cache improved significantly
- Windows 2003 64 bit system PHP running error: 1% is not a valid Win32 Application
- Interview with Mo Tianlun | ivorysql wangzhibin - ivorysql, an Oracle compatible open source database based on PostgreSQL
- PHP code audit 2 - these functions must be known and understood
- Laravel document sorting 9. Blade template
- Hello CTP (III) - CTP quotation API
- 95% 程序员都在这里摸鱼……
猜你喜欢

长沙“求才”:“下力气”与“出实招”并进,“快发展”和“慢生活”兼得

The 5th series of NFT works of missing parts was launched on the sandbox market platform

numpy np tips:使用opencv对数组插值放缩到固定形状 cv2.resize(res, dsize=(64, 64), interpolation=cv2.INTER_CUBIC)

acmStreamOpen返回值问题

95% 程序员都在这里摸鱼……

练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。

Cesium graphic annotation circle, square, polygon, ellipse, etc

Coinlist how to operate the middle lot number security tutorial

5 key indicators of SEO: ranking + traffic + session + length of stay + bounce rate

Development of trading system (V) -- Introduction to Sinovel counter
随机推荐
【LeetCode】22. 括号生成
MySQL插入过程报错1062,但是我没有该字段。
[openwrt] we recommend a domestically developed version of openwrt, an introduction to istoreos. It is very easy to use. It is mainly optimized. It solves the problem of Sinicization.
Where is the red area of OpenCV?
client-go gin的简单整合十一-Delete
地方/園區產業規劃之 “ 如何進行產業定比特 ”
《Missing Parts》NFT 作品集第 5 系列上线 The Sandbox 市场平台
web3.eth. Getpendingtransactions() returns null?
Laravel document sorting 1. Installation and Preliminary Configuration
练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。
Siddhartha: the book of life can be regurgitated frequently
PHP code audit 1 - php Ini
Openmmlab environment configuration
2.吹响半音阶口琴
Laravel document sorting 11. System architecture
Development of trading system (V) -- Introduction to Sinovel counter
Shutter fittedbox component
警惕超范围采集隐私-移动APP违规十宗罪
Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'
驻波比计算方法