当前位置:网站首页>Element's BFC attribute
Element's BFC attribute
2022-08-11 03:26:00 【Y-Joan Eye】
BFC is the abbreviation of Block Formatting Context
When an element has the BFC attribute enabled, the element will become an independent area, it will not affect other elements, so the layout will not be cluttered.
Characteristics when elements enable BFC
1. The vertical margin of the parent element will not overlap with the child element (to solve the problem of overlapping parent and child margins)
We talked about the problem of overlapping parent and child margins earlier. At that time, we said that the BFC attribute can be turned on
2. Elements with BFC enabled will not be covered by floating elements
3. Elements with BFC enabled can contain floating child elements (which can solve height collapse)
The previous article explained the problem of height collapse in detail, you can go and see it.
How to turn on BFC
1. Set the element to float (not recommended)
Although the parent element can be stretched, it will cause the width of the parent element to be lost, and this method will cause the element below to move up, affecting the page layout
2. Set the display property to inline-block (not recommended)
Can solve the problem of height loss, but will result in loss of width, and there will be three pixels of white space
3. Set the element's overflow attribute to a non-visible value (recommended)
Generally use the hidden attribute value, there will be a three-pixel blank problem
The side effects are relatively small, it is recommended to use
4. Set element absolute positioning (not recommended)
边栏推荐
- Idea (preferred) cherry-pick operation
- What should I do if the channel ServerID is incorrect when EasyCVR is connected to a Hikvision Dahua device and selects another cluster server?
- 二叉树相关代码题【较全】C语言
- Multi-merchant mall system function disassembly 26 lectures - platform-side distribution settings
- EasyCVR接入海康大华设备选择其它集群服务器时,通道ServerID错误该如何解决?
- The negative semantic transformation layer
- (CVPR - 2017) in depth and potential body learning context awareness feature for pedestrian recognition
- En-us is an invalid culture error solution when Docker links sqlserver
- Homework 8.10 TFTP protocol download function
- Google search skills - programmer is recommended
猜你喜欢
EasyCVR接入海康大华设备选择其它集群服务器时,通道ServerID错误该如何解决?
A practice arrangement about map GIS (below) GIS practice of Redis
添加用户报错useradd: cannot open /etc/passwd
基于改进YOLOv5轻量化的烟火检测
Detailed explanation of VIT source code
2022-08-10 第六小组 瞒春 学习笔记
VIT 源码详解
What should I do if the channel ServerID is incorrect when EasyCVR is connected to a Hikvision Dahua device and selects another cluster server?
Environment configuration of ESP32 (arduino arduino2.0 VScode platform which is easy to use?)
轮转数组问题:如何实现数组“整体逆序,内部有序”?“三步转换法”妙转数组
随机推荐
LeetCode热题(12.买卖股票的最佳时机)
作业8.10 TFTP协议 下载功能
Official release丨VS Code 1.70
Salesforce disbands the Chinese team, which CRM product is more suitable for the Chinese
面试常考的7种排序算法
树莓派入门(5)系统备份
Multi-merchant mall system function disassembly 26 lectures - platform-side distribution settings
flink The object probably contains or references non serializable fields.
常用认证机制
AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
Typescript study notes | Byte Youth Training Notes
DNS分离解析和智能解析
pathman_config、pathman_config_params 删除后,如何重建?
uni-app - 城市选择索引列表 / 通过 A-Z 排序的城市列表(uview 组件库 IndexList 索引列表)
怎么删除语句审计日志?
轮转数组问题:如何实现数组“整体逆序,内部有序”?“三步转换法”妙转数组
图解LeetCode——640. 求解方程(难度:中等)
[ADI low-power 2k code] Based on ADuCM4050, ADXL363, TMP75 acceleration, temperature detection and serial port printing, buzzer playing music (lone warrior)
js中的this问题
What problems should we pay attention to when building a programmatic trading system?