Float out of document flow The original purpose of float is to achieve text wrapping, which can be understood as partially separating from the document flow. In CSS, being out of document flow means that the box is taken out of the normal layout and other boxes are placed as if it does not exist. There are two types of separation from the document flow
clear:both
So The value of clear is left or right. In my opinion, it depends on the floating direction of Examples of clearing impact We set up three boxes A, B, and C When all three boxes are floated left: When C is not set to float: Add clear:both/clear:left to B: As you can see, the floating effect caused by B itself is cleared, and its top border is below Add a pseudo-element to the parent box::after Now, we use a Remove the float of out: This is as it should be. Add a pseudo element to the box .box::after{ clear: both; height:10px; width:10px; background:yellow; display: block; content: ""; } Now the float effect of the outer box ## Finish This is a basic knowledge point of CSS, but I have never read it carefully. This time I sorted it out. If there are any mistakes, please correct me if you see this article. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: MySQL Full-text Indexing Guide
>>: Solution to Docker disk space cleaning
Table of contents Preface The relationship betwee...
Table of contents 1. Understanding 2. Use 1. h() ...
In many apps and websites, when we log in or regi...
Table of contents Preface text parameter example ...
Table of contents Getting Started with MySQL MySQ...
Windows installation mysql-5.7.17-winx64.zip meth...
Achieve results Implementation Code html <div ...
Optimizing large amounts of database data is a hu...
Despite props and events, sometimes you still nee...
Method 1: Submit via the submit button <!DOCTY...
This article shares the specific code of JavaScri...
1. <body> tag: Used to mark the main body o...
This article shares the specific code of js to im...
Table of contents 1. Operator 1.1 Arithmetic oper...
cursor A cursor is a method used to view or proce...