当前位置:网站首页>flex三列布局
flex三列布局
2022-07-26 08:10:00 【MonsterQy】
背景
提起三列
布局大家应该都会想到:左右固定宽高,中间自适应的(比如说圣杯布局、双飞翼布局…)但其实有的时候在项目中我们往往会遇到另一类三列布局:中间固定宽高、左右自适应的三列布局页面。第一类三列布局的实现多种多样,但自从css3中出现了flex布局之后,通过flex布局的实现广受好评。
实现:
第一类的flex实现代码如下(左右固定宽高,中间自适应的):
html结构:
<div class='wrap'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
</div>
css代码:
.wrap{
display:flex;
}
.left,.right{
flex-grow: 1;
}
.center{
width:1200px;
}
第二类的flex实现代码如下(中间固定宽高、左右自适应的):
html结构:
<div class='wrap'>
<div class='left'></div>
<div class='center'></div>
<div class='right'></div>
</div>
css代码:
.wrap{
display:flex;
}
.left,{
order: -1;
flex: 0 0 100px;
}
.right{
flex: 0 0 100px;
}
.center{
flex-grow: 1;
}
总结:
flex布局实现三列响应式的核心点其实就在于对想要具有响应式特性的div设置flex-grow:;
边栏推荐
- [uniapp] encapsulation of multiple payment methods
- 为啥谷歌的内部工具不适合你?
- ORACLE 官方文档
- Exam summary on June 27, 2022
- es6中函数默认参数、箭头函数、剩余参数-讲解
- Master slave database deployment
- 2W word detailed data Lake: concept, characteristics, architecture and cases
- 1. MySQL Architecture [MySQL advanced]
- Traversal mode of list, set, map, queue, deque, stack
- Distributed system and distributed database system (Introduction)
猜你喜欢

Excel file parsing

Let's talk about the three core issues of concurrent programming.

Strtus2历史漏洞复现

数组的介绍--Array

Use js to count the number of occurrences of each string in the string array, and format it into an object array.

2022-07-13 group 5 Gu Xiangquan's learning notes day06

2022-07-14 group 5 Gu Xiangquan's learning notes day07
![[uniapp] encapsulation of multiple payment methods](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[uniapp] encapsulation of multiple payment methods

R language foundation

利用js实现统计字符串数组中各字符串出现的次数,并将其格式化为对象数组。
随机推荐
《门锁》引爆独居安全热议 全新海报画面令人窒息
美女裸聊一时爽,裸聊结束火葬场!
Oracle 常用函数
这是一张图片
99 multiplication table and inverted triangle 99 multiplication table
Official Oracle document
Add traceid to the project log
The difference between equals() and = =
Burp Suite - Chapter 1 burp suite installation and environment configuration
2022/7/12 exam summary
[fastjson1.2.24 deserialization vulnerability principle code analysis]
Burp suite Chapter 8 how to use burp intruder
Burp Suite-第三章 如何使用Burp Suite代理
Leetcode sword finger offer special (I) integer
Master slave database deployment
Use js to count the number of occurrences of each string in the string array, and format it into an object array.
How to close the high-level port
Spotty music data client_ ID account
Burp Suite-第六章 如何使用Burp Spider
Burp Suite - Chapter 2 burp suite proxy and browser settings