当前位置:网站首页>Mobile web training day-2
Mobile web training day-2
2022-06-28 13:06:00 【HHppGo】
3. Flex Layout
3.1 Part of the
- effect :
- be based on Flex Accurately and flexibly control the layout of block level boxes , Avoid separation from document flow in floating layout .
- Flex Layout Very suitable for structured layout
- Setting mode :
- The parent element adds
display: flex - Tips : there Parent element Must be Dad
- The parent element adds
- Part of the :
- Elastic container : Parent element , Dad
- Elastic box : Subelement
- Spindle : The default is the horizontal direction , therefore flex By default, the layout is arranged horizontally along the main axis
- Side axle : The default is vertical
3.2 Spindle alignment :justify-content
effect : Adjust the spacing between the main axes of the elastic box
/* flex Layout */
display: flex;
/* Adjust the horizontal spacing */
/* The default value is , From left to right , No spacing */
/* justify-content: flex-start; */
/* The default value is , From right to left , No spacing */
/* justify-content: flex-end; */
/* Center along the main axis , No spacing */
/* justify-content: center; */
/* In the direction of the spindle , Each box has the same left-right spacing */
/* justify-content: space-around; */
/* In the direction of the spindle , The leftmost and rightmost boxes are close to the left and right of the parent , The gap tie is allocated to other joint ventures */
/* justify-content: space-between; */
/* In the direction of the spindle , Each elastic box has the same spacing */
justify-content: space-evenly;
3.3 Side axis alignment :align-items

effect : Adjust the position of the side axis direction of the elastic box
The key is Vertical center :
center
.box {
/* Horizontal arrangement */
display: flex;
/* Side axis alignment : Vertically centered ( important ) */
/* align-items: center; */
/* The default value is , The elastic box will move along the side axis Stretch to the height of the elastic container */
align-items: stretch;
height: 300px;
margin: auto;
border: 1px solid #000;
}
/* Elastic box size description : Elastic layout , If the elastic box is not set with a fixed size , The default is the content size A flexible box , Similar to inline block display mode , Can set size , The default box size can also be determined by the content */
3.4 Expansion ratio

effect : Adjust the width of the elastic box occupying the rest of the elastic container
Code :
/* Means to divide the remaining part of the elastic container into 2 branch 2 Elastic box No 2 Share */
/* The second elastic box */
.box div:nth-child(2) {
/* Set the elastic box expansion ratio */
flex: 2;
}
effect :
Code :
/* Means to divide the remaining part of the elastic container into 6 branch 2 Elastic box No 2 Share 3 Elastic box No 4 Share */
/* The second elastic box */
.box div:nth-child(2) {
/* Set the elastic box expansion ratio */
flex: 2;
}
/* The third elastic box */
.box div:nth-child(3) {
flex: 4;
}
effect :
边栏推荐
- [cloud native] can self-service reports and Bi do so many things?
- Hisilicon 35xx realizes gt911 touch screen function "suggestions collection"
- ASP. NET CORE Study04
- c语言中的类结构体-点号
- Buuctf:[wustctf2020] plain
- 专业英语历年题
- How does Quanzhi v853 chip switch sensors on Tina v85x platform?
- codeblocks mingw安装配置问题
- 电脑无线网络不显示网络列表应该如何解决
- How to install SSL certificates in Microsoft Exchange 2010
猜你喜欢

I²C、SMBus、PMBus关系

求职简历的书写技巧

Oceanwide micro fh511 single chip microcomputer IC scheme small household appliances LED lighting MCU screen printing fh511

895. 最长上升子序列

FS7022方案系列FS4059A双节两节锂电池串联充电IC和保护IC

Tencent has confirmed that QQ has stolen numbers on a large scale, iphone14 has no chance of type-C, and 5g, the fourth largest operator, has officially released numbers. Today, more big news is here

Wi-Fi 7 来啦,它到底有多强?

Flutter series part: detailed explanation of GridView layout commonly used in flutter

MySQ 8.0 推出直方图,性能大大提升!

Copying open source for basic software is not advisable. Self reliance is the right way
随机推荐
移动Web实训DAY-1
ASP. NET CORE Study09
STM32F1与STM32CubeIDE编程实例-矩阵键盘驱动
投资98万美元的Saas项目失败了
How to install SSL certificates in Microsoft Exchange 2010
Understand leveldb write operation
Oceanwide micro fh511 single chip microcomputer IC scheme small household appliances LED lighting MCU screen printing fh511
一种跳板机的实现思路
June 28, 2022 Daily: Lecun's latest paper: the road to autonomous machine intelligence
flink核心之watermarker
Manjaro easyconnecy error: libgtk-x11-2.0 so. 0: cannot open shared object file: No such file or directory
An idea plug-in that automatically generates unit tests, which improves the development efficiency by more than 70%!
I ² C. SMBus, pmbus relationships
. Net hybrid development solution 24 webview2's superior advantages over cefsharp
求职简历的书写技巧
matlab plotyy 坐标轴设置,[转载]Matlab plotyy画双纵坐标图实例[通俗易懂]
The English translation of heartless sword Zhu Xi's two impressions of reading
VSCode 快捷键
Which securities company is the best and safest? How to open an account is the safest
ASP. NET CORE Study05

