当前位置:网站首页>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>边栏推荐
- The tiobe programming language ranking is an indicator of the popular trend of programming languages
- MySQl基础
- H5 适配全面屏
- Strong push, quick start to software testing
- Seata四大模式之XA模式详解及代码实现
- Laravel8 implementation of picture verification code
- Open source ecology 𞓜 super practical open source license basic knowledge literacy post (Part 2)
- 网上有真实的兼职吗?大学生怎么找暑期兼职?
- Go 分组 & 排序
- 树莓派网络远程访问
猜你喜欢

Visual display of TEQC quality analysis results using teqcplot

组合式API-composition-api

Event日志关键字:EventLogTags.logtags

Zygote process

面对新的挑战,成为更好的自己--进击的技术er

JDBC入门学习(二)之封装工具类

Web 应用程序安全测试指南
![[microservices | Nacos] Nacos realizes data isolation of multi environment and multi tenant](/img/dc/f00a780e96032c0b7d9b6d7c2267d1.png)
[microservices | Nacos] Nacos realizes data isolation of multi environment and multi tenant

JVM原理之完整的一次GC流程

Three tier architecture experiment
随机推荐
第九章 APP项目测试(1)
JVM原理之完整的一次GC流程
One or more lines of text overflow, ellipsis instead
STM32cube CMSIS_V2 freeRTOS Queue 队列使用
Spark 离线开发框架设计与实现
Zygote进程
Hcip reissue experiment
[leetcode] longest increasing subsequence problem and its application
Hcip switch experiment
Missing essential plugin
BGP experiment
Investment risk management
Arduino temperature and humidity sensor DHT11 (including code)
Difficult to find a job in a bad environment? Ali on three sides. Fortunately, he has made full preparations and has offered
李宏毅《机器学习》丨5. Tips for neural network design(神经网络设计技巧)
Error related to synchronizing domestic AOSP code
Introduction and use of precise ephemeris
insert into... Where not exists insert to avoid repeated use
投资风险管理
Three tier architecture experiment