Understanding of haslaylout and bfc parsing

Understanding of haslaylout and bfc parsing
1. haslayout and bfc are IE-specific and standard attributes.

2. BFC is an isolated independent container on the page. The child elements inside the container will not affect the elements outside, and vice versa.

3. BFC has 3 functions:

1. Contains floating elements,

2. Prevent overlap in screenwriting,

3. Prevent being covered by floating elements

4. Trigger conditions:

float value other than None
overflow values ​​other than visible (hidden, auto, scroll)
display (table-cell, table-caption, inline-block, flex, inline-flex)
The position value is (absolute, fixed)
The fieldset element

It is important to remember that bfc is an independent container that does not affect other layouts and will not be affected. By using its characteristics, you can solve problems such as clearing floats and 2-column layouts.

Example: 2-column adaptive layout

1. Solve it with floating and negative margin

2. Trigger bfc and will not be covered by floating elements

<<:  Implementation of CSS text shadow gradually blurring effect

>>:  HTML Editing Basics (A Must-Read for Newbies)

Recommend

JavaScript object-oriented implementation of magnifying glass case

This article shares the specific code of JavaScri...

CSS code to achieve background gradient and automatic full screen

CSS issues about background gradient and automati...

Use of kubernetes YAML files

Table of contents 01 Introduction to YAML files Y...

Vue implements image dragging and sorting

This article example shares the specific code of ...

A more elegant error handling method in JavaScript async await

Table of contents background Why error handling? ...

Detailed tutorial on deploying Jenkins based on docker

0. When I made this document, it was around Decem...

Vue network request scheme native network request and js network request library

1. Native network request 1. XMLHttpRequest (w3c ...

Solve the problem of OpenLayers 3 loading vector map source

1. Vector Map Vector graphics use straight lines ...

How to configure Hexo and GitHub to bind a custom domain name under Windows 10

Hexo binds a custom domain name to GitHub under W...

MYSQL updatexml() function error injection analysis

First, understand the updatexml() function UPDATE...

JavaScript to show and hide images

JavaScript shows and hides pictures, for your ref...

CSS injection knowledge summary

Modern browsers no longer allow JavaScript to be ...