Css float, css float
First, let's talk about float: A floating box can be moved to the left to the right until its outer edge hits the include box or another floating box.
Floating is very important in css styles. Let's take a look at the characteristics of floating:
1. separated from the standard Document Stream (de-standard for short), once an element is out of the standard text stream, the following elements occupy the original position of the floating element, once the element is floating, therefore, you do not have to observe the features of block-level elements and intra-row elements in the Document Stream.
2. element floating will be separated from the document stream, but will not be separated from the text stream, so it will produce a word circle effect.
3. Peer interaction.
Impact of floating:
1. It can make the layout of floating elements messy.
2. Child element floating will affect the parent element.
How to clear floating:
1. Add height to the floating outer element (not recommended)
2. overflow: hidden overflow hidden
3. clear: the impact of both clearing floating.
4. Wall Partitioning Method: ① internal wall method ② external wall method (not only can floating be eliminated, but also the parent element can be given a height)
Possible float values:
1. The left element floats to the left.
2. The right element floats to the right.
3. Default Value of none. The element is not floating and is displayed in the text.
4. inherit specifies that the float attribute value should be inherited from the parent element.