Home > Web Front-end > CSS Tutorial > css don't forget to clear floating clear:both_Experience exchange

css don't forget to clear floating clear:both_Experience exchange

WBOY
Release: 2016-05-16 12:06:15
Original
1975 people have browsed it
Clear with empty tag
.clr {clear: both;}


 
Left div>



Use the overflow attribute
#layout {overflow:auto; zoom:1;}


Left



Use :after (non-IE browser)
#layout:after{
display: block;
clear: both; content: "";
visibility:hidden; height: 0;
}


Left


Note: There are a few points to note when using :after, set the height to zero ( height: 0;); content is required, but its value can be empty
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template