ie6中margin失效问题

在div的外面添加父级div并设置 padding-bottom: 10px;

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>

.clear {
zoom: 1;
/*iE 6;*/
}

.clear:after {
content: "";
display: block;
clear: both;
}

.wrap {
padding-bottom: 10px;
}

#div1 {
100px;
height: 100px;
background: red;
float: left;
}

#div2 {
200px;
height: 100px;
background: yellow;
}
</style>
</head>
<body>
<div class="wrap clear">
<div id="div1"></div>
</div>
<div id="div2"></div>

</body>
</html>
原文地址:https://www.cnblogs.com/theWayToAce/p/5559304.html