当前位置:网站首页>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
边栏推荐
- Perfect guide | how to use ODBC for agent free Oracle database monitoring?
- Do you really understand CMS garbage collector?
- Multi activity disaster recovery construction after 713 failure of station B | takintalks share
- [nuxt 3] (XII) project directory structure 2
- 分布式系统架构理论与组件
- Feign的整体流程
- Plus SBOM: assembly line BOM pbom
- Flinksql synchronizes data from Oracle to Doris, with a total of more than 50 fields and more than 30 million entries in Oracle tables
- 如何调试JNI程序
- Zhongke Lanxun fell 30% on the first day of listing: Huang Zhiqiang, 60, started a company with a market value of 7.7 billion
猜你喜欢

A survey of video game addictive behavior research

Qt优秀开源项目之十三:QScintilla

CVPR22 | 关系意识的图神经架构搜索

Background and framework introduction and basic environment preparation of hucang integrated e-commerce project

Amd adrenalin 22.7.1 driver update: double the performance of OpenGL and support Microsoft win11 22h2 system

Aike AI frontier promotion (7.27)

@Simple understanding and use of conditionalonproperty

Xposed+fdex2 app shelling (black cat complains about app shelling)

ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!

How to pass parameters in JNI program
随机推荐
Feign's overall process
能说一说 Kotlin 中 lateinit 和 lazy 的区别吗?
clear
元素的层级
Do you really understand CMS garbage collector?
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
文章复现:SRCNN
JS single thread understanding notes - Original
Bank case | ZABBIX cross version upgrade guide, isn't 4.2-6.0 popular?
爬虫
Gan: generate adversarial networks
[expression calculation] double stack: general solution of expression calculation problem
Sff1004-mhchxm diode sff1004
Lambda expression
Why do you need foreign keys?
POJ2594 Treasure Exploration【二分图最小路径覆盖】【Floyd】
A survey of video game addictive behavior research
Pyside6/pyqt development experience summary (2) - set shortcut keys
插入排序,正序,倒序
Poj1273 drainage ditches [maximum flow] [SAP]