当前位置:网站首页>For a detailed explanation of flex:1, flex:1
For a detailed explanation of flex:1, flex:1
2022-06-24 08:14:00 【imkaifan】
flex:1 Is a concatenation of three attributes :flex-grow、flex-shrink、flex-basis
flex-grow: Property defines the method scale of the project , The default is 0, That is, if there is any remaining space , Not to zoom in
If all the projects flex-grow All for 1, Then they will divide the remaining space equally .
If a project flex-grow The attribute is 2, Everything else 1, Then the former will occupy twice as much space as the other items .
flex-shrink: Attribute defines the reduction ratio of the project , The default is 1, namely : If there is not enough space , The change project will be reduced .
If all of the items flex-shrink The attribute is 1, When space runs out , Just wait for the scale to shrink .
If a project flex-shrink The attribute is 0, Other projects are 1, When there's not enough space , by 0 It doesn't shrink .
flex-basis: Property defines before allocating extra space , Spindle space occupied by the project .
Browser according to this property , Calculate if the spindle has extra space , Its default value is auto, That is, the original size of the project
It can be set to follow width or height Property is the same value ( such as 350px), Then the project will occupy a fixed space .
also basis and width At the same time basis Will be able to width kill
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.box {
width: 500px;
height: 100px;
background-color: hotpink;
display: flex;
}
.box div {
width: 100px;
}
.box div:nth-child(1) {
flex-basis: 50px;
}
.box div:nth-child(2) {
flex-basis: 100px;
}
.box div:nth-child(3) {
flex-basis: 50px;
}
</style>
</head>
<body>
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
</body>
</html>

flex:flex The attribute is flex-grow, flex-shrink and flex-basis Abbreviation , The default value is 0 1 auto
This property has two shortcut values :auto (1 1 auto) and none (0 0 auto).
边栏推荐
- 宝塔面板安装php7.2安装phalcon3.3.2
- Simple summary of lighting usage
- JVM underlying principle analysis
- Oracle advanced SQL qualified query
- 自动化测试的未来趋势
- Decltype usage introduction
- More than observation | Alibaba cloud observable suite officially released
- decltype用法介绍
- Unity culling related technologies
- Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
猜你喜欢

Vulnhub target: boredhackerblog_ CLOUD AV

From jsonpath and XPath to spl

SCM stm32f103rb, BLDC DC motor controller design, schematic diagram, source code and circuit scheme

Part 1: building OpenGL environment

模型效果优化,试一下多种交叉验证的方法(系统实操)

Gossip: what happened to 3aC?

Oracle advanced SQL qualified query
![[run the script framework in Django and store the data in the database]](/img/6b/052679e5468e5a90be5c4339183f43.png)
[run the script framework in Django and store the data in the database]

Model effect optimization, try a variety of cross validation methods (system operation)

C语言_字符串与指针的爱恨情仇
随机推荐
Graphmae - - lecture rapide des documents
Pagoda panel installation php7.2 installation phalcon3.3.2
The first exposure of Alibaba cloud's native security panorama behind the only highest level in the whole domain
GraphMAE----论文快速阅读
Model effect optimization, try a variety of cross validation methods (system operation)
一文理解同步FIFO
[run the script framework in Django and store the data in the database]
1-4metaploitable2 introduction
Future trends in automated testing
Review of postgraduate English final exam
C语言_字符串与指针的爱恨情仇
Opening chapter of online document technology - rich text editor
AWTK 最新动态:Grid 控件新用法
From jsonpath and XPath to spl
Installation and use of selenium IDE
Keep one decimal place and two decimal places
5-if语句(选择结构)
搜索与推荐那些事儿
OC Extension 检测手机是否安装某个App(源码)
Solution of electric education system for intelligent supervision station