-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path元素外间距重叠.html
More file actions
42 lines (37 loc) · 873 Bytes
/
Copy path元素外间距重叠.html
File metadata and controls
42 lines (37 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
margin: 0;
}
.rect {
height: 40px;
border: solid 1px black;
background-color: aquamarine;
margin: 20px 0;
}
#d2 {
margin: 30px 0;
}
#box {
margin: 10px;
/* border: solid 1px red; */
background-color: red;
}
</style>
</head>
<body>
<!-- 块元素与块元素之间的上下外间距会产生重叠,按照两个元素较大的外间距显示 -->
<!-- 相邻的两个块元素,子元素和父元素的外间距都会产生重叠 -->
<div id="box">
<div class="rect"></div>
<div class="rect" id="d2"></div>
<div class="rect"></div>
</div>
</body>
</html>