<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>边距重叠3</title>
<style>
.box3 {
width: 200px;
height: 200px;
background-color: aqua;
margin-bottom: 40px;
}
.box4 {
margin-top: 20px;
height: 1px;
margin-bottom: 20px;
background-color: blue;
}
.box5 {
margin-top: 20px;
width: 200px;
height: 200px;
background-color: red;
}
.box6 {
width: 40px;
height: 40px;
background-color: green;
}
</style>
</head>
<body>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>
<div class="box6"></div>
</body>
</html>
上述运行结果: