Home >Web Front-end >CSS Tutorial >Introduction to clearing floats (clearfix) in css

Introduction to clearing floats (clearfix) in css

王林
王林forward
2020-05-09 09:09:252830browse

Introduction to clearing floats (clearfix) in css

Clear floating clearfix

(Video tutorial recommendation: css video tutorial)

Example code:

.clearfix:after, .clearfix:before {    
    content: " ";    
    display: table;
}
.clearfix:after {    
    clear: both;
}    
.clearfix{zoom:1;/*为IE6,7的兼容性设置*/}

Recommended tutorial: css quick start

The above is the detailed content of Introduction to clearing floats (clearfix) in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete