webveuje/teaching/heshubao/float.html
2021-06-03 10:52:41 +08:00

48 lines
1.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.box{
overflow: auto;
}
.item {
width: 100px;
height: 100px;
background-color: black;
border-right: 1px solid white;
float: left;
}
.item1 {
width: 100px;
height: 150px;
background-color: red;
border-right: 1px solid white;
/* float: left; */
/* clear:both; */
}
</style>
</head>
<body>
<div class="box">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<!-- <div style="clear:both"></div> -->
</div>
<div class="item1"></div>
</body>
</html>