解决float引起高度塌陷
作者:
zhcnnet | 来源:发表于
2018-04-24 23:10 被阅读16次<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
.d1
{
border: 1px solid red;
}
.d2
{
height: 50px;
width: 50px;
background-color: #555;
float: left;
}
.clear
{
_zoom: 1;/*ie6*/
*zoom: 1;/*ie7*/
}
.clear:after
{
content: '';
display: block;
clear: both;
}
</style>
</head>
<body>
<div class="d1 clear">
<div class="d2">d</div>
</div>
</body>
</html>
本文标题:解决float引起高度塌陷
本文链接:https://www.haomeiwen.com/subject/pqislftx.html
网友评论