-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcss-block-layout.html
More file actions
215 lines (215 loc) · 6.15 KB
/
css-block-layout.html
File metadata and controls
215 lines (215 loc) · 6.15 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
background-color: rgb(0, 0, 0, 0.08);
box-shadow: inset 0 0 1px red;
}
body {
margin: 0;
}
header {
background-color: black;
}
header div {
color: white;
width: 600px;
margin-left: auto;
margin-right: auto;
background-color: black;
}
section:nth-child(2) {
padding: 16px;
padding-left: 0;
padding-right: 0;
}
section div {
width: 600px;
margin-left: auto;
margin-right: auto;
}
main {
width: 600px;
margin-left: auto;
margin-right: auto;
margin-top: -15px;
}
main div {
background-color: pink;
box-sizing: border-box;
border: 3px solid;
height: 40px;
width: 180px;
margin-top: 15px;
text-align: center;
line-height: 34px;
}
main div:nth-child(n+5) {
margin-left: 210px;
}
main div:nth-child(n+9) {
margin-left: 420px;
}
main div:nth-child(4n+5) {
margin-top: -205px;
}
main div:hover {
background-color: red;
}
footer {
width: 600px;
margin-left: auto;
margin-right: auto;
}
footer {
margin-top: 19px;
overflow: hidden;
/* display: flow-root; */
}
footer div {
border-bottom: 1px dotted;
margin-bottom: -1px;
padding-top: 2px;
margin-left: 1px;
}
p {
text-align: center;
margin: 0;
}
.copyright {
margin-top: 17px;
background-color: rgb(238, 138, 238);
}
span {
font-size: 16px;
background-color: greenyellow;
border: 3px solid;
margin-left: 30px;
padding: 7.75px 71px;
/* vertical-align: ; */
}
span:hover {
background-color: red;
}
span:nth-child(1) {
padding-left: 13.5px;
padding-right: 13.5px;
}
span:nth-child(3n+4) {
padding-left: 38.75px;
padding-right: 38.75px;
}
span:nth-child(10) {
padding-left: 43px;
padding-right: 43px;
}
span:nth-child(3n+1) {
margin-left: 0px;
}
.inline {
font-size: 0px;
width: 600px;
margin-left: auto;
margin-right: auto;
line-height: 50px;
}
.wrapper {
width: 600px;
margin: auto;
overflow: hidden;
}
.grid {
font-size: 0px;
margin: -7.5px -15px;
}
.item {
display: inline-block;
box-sizing: border-box;
width: 180px;
height: 40px;
border: 3px solid;
font-size: 16px;
margin: 7.5px 15px;
text-align: center;
line-height: 36px;
}
</style>
</head>
<body>
<header>
<div>
hello world 请调整浏览器窗口大小查看效果hello world
请调整浏览器窗口大小查看效果hello world 请调整浏览器窗口大小查看效果hello world
请调整浏览器窗口大小查看效果hello world 请调整浏览器窗口大小查看效果hello world
请调整浏览器窗口大小查看效果
</div>
</header>
<section>
<div>
页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体
宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px
页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体
宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px 页面主体 宽度600px
</div>
</section>
<main>
<div>宽180高40(包含边框)</div>
<div>水平间隙30px</div>
<div>垂直间隙15px</div>
<div>边框宽度3px</div>
<div>产品</div>
<div>产品</div>
<div>产品</div>
<div>产品</div>
<div>产品</div>
<div>产品</div>
<div>产品</div>
<div>产品</div>
</main>
<section class="inline">
<span>宽180高40(包含边框)</span>
<span>产品</span>
<span>产品</span>
<span>水平间隙30px</span>
<span>产品</span>
<span>产品</span>
<span>垂直间隙15px</span>
<span>产品</span>
<span>产品</span>
<span>边框宽度3px</span>
<span>产品</span>
<span>产品</span>
</section>
<div class="wrapper">
<section class="grid">
<div class="item">宽180高40(包含边框)</div>
<div class="item">产品</div>
<div class="item">产品</div>
<div class="item">水平间隙30px</div>
<div class="item">产品</div>
<div class="item">产品</div>
<div class="item">垂直间隙15px</div>
<div class="item">产品</div>
<div class="item">产品</div>
<div class="item">边框宽度3px</div>
<div class="item">产品</div>
<div class="item">产品</div>
</section>
</div>
<footer>
<div>link</div>
<div>link</div>
<div>link</div>
<div>link</div>
<div>link</div>
</footer>
<section class="copyright">
<p>©版权所有</p>
<p>本页所有布局均使用块元素</p>
</section>
</body>
</html>