css 双伪元素清除浮动

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>双伪元素清除浮动</title>

<style type="text/css">
/* 声明清除浮动的样式 */
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
/* ie6 7 专门清除浮动的样式*/
.clearfix {
*zoom:1;
}


.one {
500px;
border: 1px solid red;
}

.damao {
float: left;
200px;
height: 200px;
background-color: purple;
}
.ermao {
float: left;
250px;
height: 250px;
background-color: skyblue;
}

.two {
700px;
height: 150px;
background-color: #000;
}
</style>
</head>
<body>

<div class="one clearfix">
<div class="damao"></div>
<div class="ermao"></div>
</div>

<div class="two"></div>

</body>
</html>

原文地址:https://www.cnblogs.com/ericblog1992/p/12893045.html