Solution to css float misalignment: 1. When two elements of the same level are misaligned, add an empty label between the two elements; 2. Set the CSS attribute to ".clear{clear:both ;}" That's it.
The operating environment of this tutorial: windows7 system, css3 version, thinkpad t480 computer.
Recommended: "css video tutorial"
Solution to misalignment of elements caused by using float attribute
If two of the same level If the elements are misaligned, add an empty tag between the two elements, such as:
and then set the CSS attribute:
.clear{ clear:both; }
The above is the detailed content of How to solve the css float misalignment problem. For more information, please follow other related articles on the PHP Chinese website!