当前位置:网站首页>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>
边栏推荐
- Food safety | can you eat any fruit?
- Data query where
- SLAM 02.整体框架
- Backtracking - 491. Incremental subsequence
- Sword finger offer 24. reverse the linked list
- Food safety | what food can be heated in a microwave oven? You should know these potential safety hazards
- [wechat applet] read the article, data request
- (int argc, char** argv) command line parameters in visual stdio (VS)
- 0 basic programming resources (collect first ~ read slowly ~)
- The.Net webapi uses groupname to group controllers to render the swagger UI
猜你喜欢

UE5 官方案例Lyra 全特性详解 7.资源管理

How to view encrypted information in text form

From January to June, China's ADAS suppliers accounted for 9%, and another parts giant comprehensively laid out the new smart drive track

Implementation of dynamic and static libraries (packaging dynamic and static libraries for others to use)

一款超好用的神器Apifox,甩 Swagger 几条街...(荣耀典藏版)

Various extensions of hcip-9.ospf

SLAM 02.整体框架

Kubernetes----PV和PVC的生命周期简介

Today in history: IBM obtained the first patent; Verizon acquires Yahoo; Amazon releases fire phone

Optical distance sensing chip 4530a combining ambient light, proximity sensing and infrared ranging
随机推荐
Huawei recruited "talented teenagers" twice this year; 5.4 million twitter account information was leaked, with a selling price of $30000; Google fired engineers who believed in AI consciousness | gee
Detailed explanation of redisson distributed lock process (II)
食品安全 | 无菌蛋真的完全无菌吗?
Analysis of Wireshark data package of network security B module of national vocational college skills competition Wireshark 0051.pcap
Detailed explanation of redis's single login
Today's sleep quality record 75 points
Backtracking - 46. Full arrangement
PXE principle and configuration
In the digital era, what "golden treasure" is driving the development of pharmaceutical enterprises for a century?
关于自动重复调用接口的一种实现方式-反射
Data query where
Azure Synapse Analytics 性能优化指南(2)——使用具体化视图优化性能(上)
Where is safe to open an account when buying stocks on mobile phones?
食品安全 | 这些常见食物小心有毒!速查自家餐桌
数据库组成视图
0 basic programming resources (collect first ~ read slowly ~)
Data query function
火山引擎云上增长方案全景:30+方案齐出,兵发优势领域
一文看懂GaitSet中的test.py
Food safety | these common foods are poisonous! Check your dining table quickly