当前位置:网站首页>Use positioning to realize left, middle and right layout, and the middle content is adaptive
Use positioning to realize left, middle and right layout, and the middle content is adaptive
2022-07-26 12:56:00 【songywaa】
There are two ways to locate :
1、 Left and right positioning , The middle is normal ;
2、 Both left, middle and right use positioning ;
The first method :( Be careful div.center The location of )
.box{
position: relative;
}
.left{
position:absolute;
left: 0;
width:200px;
}
.right{
position:absolute;
right: 0;
width:200px;
}
.center{
padding:0 200px;
}
<div class="box">
<div class="left"> I am on the left </div>
<div class="right"> I'm on the right </div>
<div class="center"> I'm the middle </div>
<!-- Be careful center The location of ,!!!! To the end , Because positioning is out of the document flow does not occupy a high degree -->
</div>
The second method
.box{
position: relative;
}
.left{
position:absolute;
left: 0;
width:200px;
}
.right{
position:absolute;
right: 0;
width:200px;
}
.center{
position: absolute;
left: 200px;
right:200px;
}
<div class="box">
<div class="left"> I am on the left </div>
<div class="center"> I'm the middle </div>
<div class="right"> I'm on the right </div>
</div>
边栏推荐
- Minesweeping games - easy to play addictive (C language version)
- Yolov7 training dangerous goods identification pytorch
- 今日睡眠质量记录75分
- C regards type as generic type T and uses it as generic type of method
- 历史上的今天:IBM 获得了第一项专利;Verizon 收购雅虎;亚马逊发布 Fire Phone...
- 1-6月中国ADAS供应商占比9% 又一家零部件巨头全面布局智驾新赛道
- 14.2 byte stream learning
- Transactional transaction propagation behavior?
- 实体映射最强工具类:MapStruct真香
- 笔记。。。。
猜你喜欢

火山引擎云上增长方案全景:30+方案齐出,兵发优势领域

Backtracking - 46. Full arrangement

STM32 drives hc05 Bluetooth serial port communication module

LCD笔记(7)LCD驱动程序框架_配置时钟

全国职业院校技能大赛网络安全B模块wirshark数据包分析 wireshark0051.pcap

被罚“带薪休假”一个月后,谷歌解雇了“爱”上 AI 的他

After being fined "paid leave" for one month, Google fired him who "loves" AI

Kubernetes ---- life cycle introduction of PV and PVC

Problems and solutions in the learning process of file class
2022 employment season! Adobe helps creative industry workers break through the shackles of skills and return to the source of ability
随机推荐
Problems and solutions in the learning process of file class
C语言文件知识点
Database composition view
LCD notes (4) analyze the LCD driver of the kernel
LCD notes (5) LCD driver framework_ Use device tree
Guys, how can CDC Oracle set the reading from the specified SCN number, or how to set the read-only full archive, not to read fast
0基础编程资源大全(先收藏~慢慢看~)
The.Net webapi uses groupname to group controllers to render the swagger UI
Code error reporting and problem solving experience II: test error reporting in yolov5
The database consists of stored procedures and functions
回溯——46. 全排列
Detailed interpretation of hole convolution (input and output size analysis)
Understand test.py in gaitset
C#把Type当做泛型T,来作为方法的泛型进行使用
STM32 drives hc05 Bluetooth serial port communication module
How to remove underline and color when there is focus in the shutter textfield
Does Flink CDC only support SQL client to submit SQL scripts
数据查询WHERE
The programmed navigation route jumps to the current route (the parameters remain unchanged), and if it is executed multiple times, it will throw a navigationduplicated warning error?
回溯——491. 递增子序列