Home > Web Front-end > HTML Tutorial > clearfix clear float

clearfix clear float

WBOY
Release: 2016-09-02 08:42:55
Original
1127 people have browsed it

clearfix is ​​defined as follows:

<span style="color: #800000;">.clearfix:after</span>{<span style="color: #ff0000;">visibility</span>:<span style="color: #0000ff;">hidden</span>;<span style="color: #ff0000;">display</span>:<span style="color: #0000ff;">block</span>;<span style="color: #ff0000;">font-size</span>:<span style="color: #0000ff;">0</span>;<span style="color: #ff0000;">content</span>:<span style="color: #0000ff;"> ” “</span>;<span style="color: #ff0000;">clear</span>:<span style="color: #0000ff;">both</span>;<span style="color: #ff0000;">height</span>:<span style="color: #0000ff;">0</span>;}<span style="color: #800000;">
.clearfix</span>{<span style="color: #ff0000;">*zoom</span>:<span style="color: #0000ff;">1</span>;}
Copy after login

Method: If the child node is set to float, add the clearfix class to its parent node to achieve the clearing effect

Reference: http://blog.sina.com.cn/s/blog_60b35e830101c1r8.html

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