css清除浮动,自动撑大外层盒子
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<title>css清除浮动,自动撑大外层盒子</title>
<style>
.box{width:960px; margin: 0 auto; background: green;}
.clear{-ms-zoom:1;}
.clear:after{content: '';display: block;clear: both;}
.left{width: 200px; height: 600px;float: left; background: red;}
.right{width: 750px; height: 600px; float: right; background: blue}
</style>
</head>
<body>
<div class="box clear">
<div class='left'></div>
<div class='right'></div>
</div>
</body>
</html>