当前位置:网站首页>Three implementation methods: left fixed and right adaptive (Flex, float + BFC, float margin left)
Three implementation methods: left fixed and right adaptive (Flex, float + BFC, float margin left)
2022-06-23 05:24:00 【PHP code】
// structure
<div class="demo">
<div class="left"></div>
<div class="right"></div>
</div>
1.Flex
<style>
* {
padding: 0;
margin: 0;
}
.demo {
overflow: hidden;
display: flex;
}
.left {
width: 200px;
height: 200px;
background-color: red;
}
.right{
height: 200px;
background-color: aquamarine;
flex: 1;
}
</style>
2.float + BFC
<style>
* {
padding: 0;
margin: 0;
}
.demo {
overflow: hidden;
}
.left {
width: 200px;
height: 200px;
background-color: red;
float: left;
}
.right {
height: 200px;
background-color: aquamarine;
/* formation BFC The box */
overflow: auto;
}
</style>3.float + margin-left
<style>
* {
padding: 0;
margin: 0;
}
.demo {
/* Remove the floating */
overflow: hidden;
}
.left {
width: 200px;
height: 200px;
background-color: red;
float: left;
}
.right {
height: 200px;
background-color: aquamarine;
/* Fixed box width */
margin-left: 200px;
}
</style>边栏推荐
猜你喜欢

Difficult to find a job in a bad environment? Ali on three sides. Fortunately, he has made full preparations and has offered

konva 系列教程 1:konva 是什么?

When SBAS encounters rtklib

Complete the primary school project in 3 days, and teach you to complete the weather broadcast system hand in hand!
![[leetcode] longest increasing subsequence problem and its application](/img/e0/d666dccec1f65eed61fce83ac2190a.png)
[leetcode] longest increasing subsequence problem and its application

Three methods of GNSS velocity calculation

MCS: continuous random variable chi square distribution

人脸识别 确定阈值

物联网开源开发平台 Shifu 开放内测!第一版技术文档发布

GO语言-自定义error
随机推荐
MCS:连续随机变量——Chi-Square分布
MCS: continuous random variable lognormal distribution
人脸识别 确定阈值
关于信息泄露和防御
Economic development is driven by new technology
The propeller framework v2.3 releases the highly reusable operator library Phi! Restructure development paradigm to reduce cost and increase efficiency
左侧固定,右侧自适应 三种实现办法(Flex,float + BFC ,float-margin-left)
Event log keyword: eventlogtags logtags
MCS: discrete random variable Bernoulli distribution
618 how to break through the siege? Haier Zhijia: do a good job in digitalization of users
Open source ecology 𞓜 super practical open source license basic knowledge literacy post (Part 2)
OSPF shunt test
Onnxoptimizer, onnxsim usage records
MySQL自定义序列数的实现
投资风险管理
JDBC入门学习(一)之DML操作
One or more lines of text overflow, ellipsis instead
如何进行探索性数据分析
【微服务|Nacos】Nacos实现多环境和多租户的数据隔离
markdown给图片加背景色