浮动之清除after伪元素
程序员文章站
2024-01-29 12:46:28
...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.clearfix:after{
content: "";
display: block;
height: 0;
clear:both;
visibility: hidden;
}
.clearfix{*zoom:1;}
.father{
background-color: pink;
width: 600px;
border: 1px solid #000;
}
.bigson{
float: left;
width: 200px;
height: 200px;
background-color: red;
}
.twoson{
float: left;
width: 300px;
height: 300px;
background-color: yellow;
}
.two{
width: 500px;
height: 300px;
background-color: green;
}
</style>
</head>
<body>
<div class="father clearfix">
<div class="bigson"></div>
<div class="twoson"></div>
</div>
<div class="two"></div>
</body>
</html>
上一篇: Oracle分区表常用命令
下一篇: PHP简单读取和写入文件的方法