css 等高补偿法

 

html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.wrap{
overflow:hidden;
}
.box{
margin-bottom:-9999px;
padding-bottom:9999px;
width:200px;
float:left;
}
.box1{
background:red;
}
.box2{
background:green;
}
</style>
</head>
<body>
<div class="wrap">
<div class="box box1">1222</div>
<div class="box box2">1222221111111111111111111111111111111111111111111112<br><br><br><br><br></div>
</div>
</body>
</html>

效果图

 

posted @ 2016-03-15 14:37  青草圆  阅读(176)  评论(0编辑  收藏  举报