1. Use a pseudo-class: after will be used to clear the pseudo-class layer with a null height and zero bit
2. Use css overflow: auto to raise the bar
3. Use css overflow: Den to generate weird adaptation
4. Use display: table to convert objects into tables.
5. Use the div label and the clear attribute of css.
6. Use the br label and the clear attribute of css.
7. Use the br tag and the clear attribute of its own html
In a rough view, they can solve the problem. However, they have their own advantages and disadvantages on the other hand. (One-to-one correspondence)
1. Advantages structure semantics is completely correct and will not cause any other weird problems.
Disadvantages: improper reuse may cause a sharp increase in the amount of code.
It is recommended that the outermost layer be used for light floating or clear modular reuse.
2. Advantages structure semantics is completely correct, and the amount of code is very small.
Disadvantages after multiple nesting, clicking the light floating box on the outermost layer will be selected as the outermost layer to the innermost layer (ff ); or when the width of the mouseo tutorial ver changes, the outermost layer module has a scroll bar (ie ).
We recommend that you use the internal modules. Do not nest them.
3. Advantage structure semantics is completely correct, and the amount of code is very small.
When the content is increased, it is easy to avoid line breaks and the content is hidden.
We recommend that you use it when the width is fixed. Do not nest it.
4. Advantage structure semantics is completely correct, and the amount of code is very small.
The downsides of the box model have changed. As you can imagine, there are naturally more singular events than you can count.
It is recommended that you do not use it if you do not want to change the bug to death. However, it can be used as a temporary test in alpha version.
5. The advantage code is very small, and the reusability is extremely high.
Disadvantages are completely unable to perfectly adapt to semantics, which is not conducive to revision and demand changes.
It is recommended for beginners to solve floating problems quickly.
6. Advantages: the semantic level is better than 5th cases; the amount of code is very small, and the reusability is extremely high.
Disadvantages: the semantics is still not perfect, which is not conducive to revision and demand change.
It is recommended for beginners to solve floating problems quickly.
7. Advantages: the semantic level is better than that in 5th and 6 cases; the code volume is the least, and the reusability is extremely high.
Disadvantages: the semantics is still not perfect, which is not conducive to revision and demand change.
It is recommended to guide beginners to think about how to use the classname to control the performance. It is better to use html attributes to control the performance of webpages that return to the era of web1.0, after all, the latter has less code.