This article mainly explains how to use clearfix and clear in html for kids shoes who have just begun to understand css. I will not write the clearfix and clear styles here.
The following describes the usage of these two classes. First, let's take a look at the example:
How to Use clearfix and clear in html
Since it is a problem caused by floating, you only need to clear the floating. I believe there are many methods to clear the floating, such as overflow: hidden. The following describes how to use clearfix and clear to clear float.
How to Use clearfix and clear in html and clear floating with clear
It is difficult to describe which of the two methods is better. You can only describe specific requirements.
Some may ask, why is the clearfix style clear? What are the meanings of these styles? This requires children's shoes to have a certain understanding of the pseudo class of css. For details, click.