当前位置:网站首页>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:;
边栏推荐
- Burp suite Chapter 7 how to use burp scanner
- 2022-07-13 group 5 Gu Xiangquan's learning notes day06
- Matlab drawing black spots on two / three-dimensional drawings
- 有点牛逼,一个月13万+
- Now developers are beginning to do testing. Will there be no software testers in the future?
- Lnmp+wordpress to quickly build a personal website
- 一点一点理解微服务
- 2022 / 7 / 16 exam summary
- Template summary
- Using ordered dictionary to copy pcap files
猜你喜欢

AQS implementation principle

Master slave database deployment

Introduction to arrays -- array

小组成员参加2022中国多媒体大会

BGP选路原则

table 固定特定行

If the thread crashes, why doesn't it cause the JVM to crash? What about the main thread?
![[uniapp] encapsulation of multiple payment methods](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[uniapp] encapsulation of multiple payment methods

一文掌握mysql数据库审计特点、实现方案及审计插件部署教程

C# 获取选择文件信息
随机推荐
Burp Suite-第八章 如何使用Burp Intruder
Idea settings set shortcut keys to convert English letters to case in strings
BGP --- 边界网关协议
Excel file parsing
Abstract classes and interfaces
Rewriting and overloading
C # get the information of the selected file
The difference between LinkedList and ArrayList
Software engineering -- dental clinic -- demand analysis
Utils connection pool
No valid host was found when setting up openstack to create an instance There are not enough hosts available. code:500
我,35岁了。
The difference between throw and throws?
《门锁》引爆独居安全热议 全新海报画面令人窒息
Summary of traversal methods of list, set, map, queue, deque and stack
The idea of stack simulating queue
If the thread crashes, why doesn't it cause the JVM to crash? What about the main thread?
A clear summary and configuration example of GPON has been highlighted
2022-07-13 group 5 Gu Xiangquan's learning notes day06
Recurrence of strtus2 historical vulnerability