首页 > 代码库 > 清除浮动2

清除浮动2

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus?">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>css_盒子</title>
<style type="text/css">
body{border: 1px solid black; }
.box1{border: 1px solid blue;width: 200px;height: 100px;float: left;}
.box2{border: 1px solid red;width: 500px;height: 100px;float: left;}
.clear{display: block;overflow: hidden; }


</style>
</head>
<body>

<div class="box clear">
<div class="box1">我是盒子1</div>
<div class="box2">我是盒子2</div>

</div>
</body>
</html>

清除浮动2