<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.box{
float: left;
width: 200px;
height: 200px;
margin: 5px;
border: solid 1px red;
}
.afterbox{
border: solid 1px orange;
clear:left;
}
.box2 {
display: inline-block;
width: 200px;
height: 200px;
margin: 1em;
border: solid 1px pink;
}
</style>
</head>
<body>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="box">我在浮动</div>
<div class="afterbox">
footer
</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="box2">我是一个box</div>
<div class="afterbox">
我没有用clear left 哦!
</div>
</body>
</html>
评论0
最新资源