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
This article mainly introduces the installation/st...
Table of contents Overview 1. Separation of front...
When I installed php56 with brew on mac , I encou...
I just started learning about databases recently....
This article example shares the specific code of ...
Preface While browsing GitHub today, I found this...
In the previous article "Understanding UID a...
Vue first screen performance optimization compone...
A cool JavaScript code to unfollow Weibo users in...
The installation tutorial of MySQL 5.7.19 winx64 ...
Preface: js is a single-threaded language, so it ...
Mysql sets boolean type 1. Tinyint type We create...
Table of contents Preface Rationale Procedure 1. ...
MySQL software installation and database basics a...
Floating ads are a very common form of advertisin...