当前位置:网站首页>Height collapse and BFC
Height collapse and BFC
2022-07-27 13:21:00 【Sorry, this person doesn't exist】
High collapse and BFC
<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> .outer{
border: 10px red solid; overflow: hidden; } .inner{
width: 100px; height: 100px; background-color: #bbffaa; /* The problem of high collapse : In a floating layout , By default, the height of the parent element is held open by the quilt element When the child element floats , It's completely detached from the document stream , The child element is detached from the document stream Will not be able to support the height of the parent element , Causes the height of the parent element to be lost After the height of the parent element is lost , The elements below it move up automatically , It leads to page layout confusion So height collapse is a common problem in floating layout , We have to deal with this problem */ float: left; } </style>
</head>
<body>
<div class="outer">
<div class="inner"></div>
</div>
</body>
</html>
BFC(Block Formatting Context) Block level formatting environment
-BFC It's a css An implicit attribute in , It can be turned on for an element BFC
Turn on BFC Calcium will become an independent layout area
- Element on BFC The characteristics of the post war era :
1、 Turn on BFC Is not overwritten by floating elements
2、 Turn on BFC The outer margins of the child element and the parent element of the element do not overlap
3、 Turn on BFC Can contain floating child elements
- There are some special ways to turn on elements BFC:
1、 Set element float ( Not recommended )
2、 Set the element as an inline block element ( Not recommended )
3、 Elemental overflow Set to a non visible Value
- Common ways : Set... For the element overflow:hidden Turn on its BFC So that it can contain floating elements
边栏推荐
- Antd's tool function getprefixcls gets the public prefix
- B站713故障后的多活容灾建设|TakinTalks大咖分享
- multi-table query
- Lambda expression
- JNI程序如何进行参数传递
- POJ1273 Drainage Ditches【最大流】【SAP】
- 力扣 1480. 一维数组的动态和 383. 赎金信412. Fizz Buzz
- JS date and time format (year, month, day, hour, minute, second, week, quarter, time difference acquisition, date and timestamp conversion function)
- Nodejs body parser middleware processes post form data of type multipart / form data, and req.body cannot receive data
- Amd adrenalin 22.7.1 driver update: double the performance of OpenGL and support Microsoft win11 22h2 system
猜你喜欢

字节跳动的 Flink OLAP 作业调度和查询执行优化实践

爱可可AI前沿推介(7.27)

Can you tell me the difference between lateinit and lazy in kotlin?

力扣 1480. 一维数组的动态和 383. 赎金信412. Fizz Buzz

「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader

MTK6765编译环境搭建

AMD Adrenalin 22.7.1 驱动更新:OpenGL 性能翻倍,支持微软 Win11 22H2 系统

Jesd204b debugging notes (practical version)

Eccv2022 | Ru & Google proposed to use clip for zero shot target detection!

v-show
随机推荐
绝对定位
Bank case | ZABBIX cross version upgrade guide, isn't 4.2-6.0 popular?
完美指南|如何使用 ODBC 进行无代理 Oracle 数据库监控?
xshell7可以登录mysql虚拟机不能登陆mysql
multi-table query
关于 CMS 垃圾回收器,你真的懂了吗?
Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions
Gan: generate adversarial networks
SSM practical project - front back separation (easy to understand)
POJ2594 Treasure Exploration【二分图最小路径覆盖】【Floyd】
A survey of video game addictive behavior research
力扣 1480. 一维数组的动态和 383. 赎金信412. Fizz Buzz
实现新增加硬盘的磁盘分区和文件系统挂载
MTK6765编译环境搭建
Optimization Practice of Flink OLAP job scheduling and query execution based on ByteDance
马斯克被曝绿了谷歌创始人:导致挚友二婚破裂,曾下跪求原谅
@Simple use of conditional
Why does the class annotated with @configuration generate cglib proxy?
Zhongke Lanxun fell 30% on the first day of listing: Huang Zhiqiang, 60, started a company with a market value of 7.7 billion
Application for the latest version of Pan domain name certificate