当前位置:网站首页>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/
边栏推荐
- Hello CTP (I) - basic knowledge of futures
- 智慧风电:数字孪生 3D 风机智能设备运维
- 2. play the chromatic harmonica
- Flutter Builder & futurebuilder components
- 【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示
- 1. Phase II of the project - user registration and login
- MySQL order by
- 升级cmake
- 【Kubernetes系列】Helm的安装使用
- Simple integration of client go gin 11 delete
猜你喜欢

Vigilance against over range collection of privacy - ten mobile app violations

马斯克发布人形机器人,AI对马斯克为什么意义重大?

client-go gin的简单整合十-Update

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

论文阅读《LSD-SLAM: Large-Scale Direct Monocular SLAM》

La gamme NFT Color, qui représente la diversité, est en ligne sur la plate - forme du marché Sandbox

1.初识半音阶口琴

代表多样性的彩色 NFT 系列上线 The Sandbox 市场平台

MySQL插入过程报错1062,但是我没有该字段。

如何绘制产业招商地图
随机推荐
微信小程序中的列表渲染
La gamme NFT Color, qui représente la diversité, est en ligne sur la plate - forme du marché Sandbox
IntStream API介绍
@Requestbody solution get parameter is null
numpy np tips: numpy数组的squeeze等处理
Numpy NP tips: use OpenCV to interpolate and zoom the array to a fixed shape cv2 resize(res, dsize=(64, 64), interpolation=cv2. INTER_ CUBIC)
Hello CTP (II) -- Introduction to CTP
95% 程序员都在这里摸鱼……
Is opencv open source?
Flutter FittedBox组件
Sourcetree pulls the code and prompts to fill in authentic, but the configuration cannot change the user
client-go gin的简单整合十-Update
讲座记录《惯性导航的新应用——惯性测量》
地方/園區產業規劃之 “ 如何進行產業定比特 ”
NFT Insider #63:The Sandbox与时代杂志达成合作,YGG成立西班牙subDAO
DAP data scheduling function improvement description
How much do you know about the use value of WMS warehouse management system
DAP数据调度功能完善说明
Simple integration of client go gin -update
1. Phase II of the project - user registration and login