当前位置:网站首页>使用float实现左中右布局,中间内容自适应
使用float实现左中右布局,中间内容自适应
2022-07-26 10:38:00 【songywaa】
使用float实现左中右布局,一定要注意中间div的位置问题
/*css*/
.left{
float:left;
width:200px;
}
.right{
float: right;
width:200px;
}
.center{
padding: 0 200px;/*使用margin也可以*/
}
<div class="box">
<div class="left">我是左边</div>
<div class="right">我是右边</div>
<div class="center">我是中间</div>
<!-- 在html中,中间自适应的div一定要放到最后边,因为左右div浮动不占高度,如果把中间div放到前边或者中间,就会把浮动元素挤到下边去 -->
</div>
边栏推荐
- 20210807#1 C语言程序结构
- IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
- Issue 7: how do you choose between curling up and lying flat
- [leetcode每日一题2021/2/13]448. 找到所有数组中消失的数字
- 控制随机抽中几率 [ C# | Random ]
- 数据库函数
- 一文详解Nodejs中fs文件模块与path路径模块
- el-table实现可编辑表格
- centos8(liunx)部署WTM(ASP.NET 5)使用pgsql
- Centos8 (liunx) deploying WTM (asp.net 5) using PgSQL
猜你喜欢
Okaleido生态核心权益OKA,尽在聚变Mining模式
SAP ABAP 守护进程的实现方式
vscode上使用anaconda(已经配置好环境)
Uniapp uses the simple method signalr (only for web debugging, cannot package apps)
链式方法调用的事务问题剖析
粽子大战 —— 猜猜谁能赢
[leetcode每日一题2021/4/23]368. 最大整除子集
在altium designer中禁用USBJATG
Redis docker instance and data structure
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming
随机推荐
Redis特殊数据类型使用场景
L2-005 set similarity (intersection of vector and set)
C language calculation date interval days
Database functions
Some web APIs you don't know
Issue 5: the second essential skill for College Students
winpcap 抓包函数pcap_loop(),停止问题
[leetcode每日一题2021/5/8]1723. 完成所有工作的最短时间
超图 影像 如何去除黑边(两种方法)
一文详解Nodejs中fs文件模块与path路径模块
[转]ArcGIS中判断两个Geometry之间的关系
json_ object_ put: Assertion `jso->_ ref_ count > 0‘ failed. Aborted (core dumped)
Okaleido ecological core equity Oka, all in fusion mining mode
构造器、方法重载、对象数组和static
JS对象赋值问题
Mlx90640 infrared thermal imager temperature sensor module development notes (VI) pseudo color coding of infrared images
hx711 数据波动大的问题
[leetcode每日一题2021/4/23]368. 最大整除子集
.net operation redis sorted set ordered set
第5期:大学生入职必备技能之二