当前位置:网站首页>使用定位实现左中右布局,中间内容自适应
使用定位实现左中右布局,中间内容自适应
2022-07-26 10:38:00 【songywaa】
定位有俩种方式:
1、左右使用定位,中间正常;
2、左中右都使用定位;
第一种方法:(注意div.center的位置)
.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">我是左边</div>
<div class="right">我是右边</div>
<div class="center">我是中间</div>
<!--注意center的位置,!!!!放到最后,因为定位脱离文档流不占高度-->
</div>
第二种方法
.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">我是左边</div>
<div class="center">我是中间</div>
<div class="right">我是右边</div>
</div>
边栏推荐
- Asynctask < T> decoration and await are not used in synchronous methods to obtain asynchronous return values (asynchronous methods are called in synchronous methods)
- RT-Thread 学习笔记(一)---配置RT-Thread开发环境
- L2-005 set similarity (intersection of vector and set)
- STM32 Alibaba cloud mqtt esp8266 at command
- MLX90640 红外热成像仪测温传感器模块开发笔记(六)红外图像伪彩色编码
- json_ object_ put: Assertion `jso->_ ref_ count > 0‘ failed. Aborted (core dumped)
- centos8(liunx)部署WTM(ASP.NET 5)使用pgsql
- [notes on machine learning] [building a cyclic neural network and its application] deeplearning ai course5 1st week programming(keras)
- 13 以对象管理资源
- 剑指Offer(五十二):正则化表达式
猜你喜欢

STM32 Alibaba cloud mqtt esp8266 at command

Mlx90640 infrared thermal imager temperature sensor module development notes (VI) pseudo color coding of infrared images

Navicat15 MySQL (centos7) connected to local virtual machine
![[leetcode每日一题2021/4/29]403. 青蛙过河](/img/fb/612777c77df5a611506e72f4f4c3c8.png)
[leetcode每日一题2021/4/29]403. 青蛙过河

sigmod 函数与softmax 函数对比

Zongzi battle - guess who can win

uniapp使用简单方法signalR(仅用于web调试,无法打包app)

Uniapp uses the simple method signalr (only for web debugging, cannot package apps)

kali 查看ip地址
![[leetcode daily question 2021/4/23]368. Maximum divisible subset](/img/0b/32ca862963c842a93f79eaac94fb98.png)
[leetcode daily question 2021/4/23]368. Maximum divisible subset
随机推荐
关于硕博士开题报告编写的思考
C语言鹏哥20210812C语言函数
11 在 operator= 中处理“自我赋值”
剑指Offer(八):跳台阶
12 复制对象时勿忘其每一个成分
json_ object_ put: Assertion `jso->_ ref_ count > 0‘ failed. Aborted (core dumped)
反射机制简述
[leetcode daily question 2021/2/18] [detailed explanation] minimum number of turns of 995. K continuous bits
干货likeshop外卖点餐系统开源啦100%开源无加密
同步方法中不使用asyncTask<T> 修饰和await获取异步返回值(同步方法中调用异步方法)
winpcap 抓包函数pcap_loop(),停止问题
datav漂亮数据屏制作体验
鹏哥C语言第四课(3)
Introduction to data analysis | kaggle Titanic mission (I) - > data loading and preliminary observation
第6期:大学生应该选择哪种主流编程语言
鹏哥C语言第七节课总结
[leetcode每日一题2021/2/14]765. 情侣牵手
Datav beautiful data screen production experience
鹏哥C语言第六节课
Asynctask < T> decoration and await are not used in synchronous methods to obtain asynchronous return values (asynchronous methods are called in synchronous methods)