index01.html
复制代码
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<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>CSS基础</title> <link href="mystyle.css" type="text/css" rel="stylesheet"> </head> <body> <h3>派生选择器:(li标签中strong样式需要加一个效果,而p标签中strong样式不需要)</h3> <p><strong>p标签</strong></p> <ul> <li><strong>li标签</strong></li> </ul> <br/> <h3>id选择器</h3> <p id="pid">this is a id</p> <div id="divid"> This div <p>This is a div<p/> <!-- 派生选择器与id选择器同时使用--> </div> <br/> <h3>类选择器</h3> <p class="pclass">This is a class effect </p> <div class="divclass"> Hello DIV<p>P标签</p> <!-- 派生选择器与class选择器同时使用--> </div> <br/> <h2>CSS盒子模型</h2> <h3>css盒子内边距</h3> <table border="1"> <tr> <td >内边距未设置</td> </tr> </table> <br/> <table border="1"> <tr> <td id="tdid">设置内边距</td> </tr> </table> <br/> <h3>css盒子边框</h3> <p id="bkid">CSS边框样式</p> <p id="radiusid">圆角边框</p> <div class="cssid">CSS阴影效果</div> <br/> <h3>CSS外边距</h3> <div class="mg">外边距</div> <h4>盒子模型实例</h4> <div class="container"> <div class="bd"> <div class="pd"> <div class="content"> 这是具体内容区域</div> </div> </div> </div> <img src="1.png"> <h3>盒子模型应用</h3> <div class="top1"> <div class="top1_container" style="text-align: center">中间</div> </div> <div class="body1"> <div class="body1_img" style="text-align: center">内容</div> <div class="body1_content"> <div class="body1_inform"></div> </div> </div> <div class="footing" > <div class="footing_content"></div> <div class="footing_menu"></div> </div> </body> </html>
复制代码
1mystyle.css
复制代码
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391复制代码/*派生选择器*/ li strong{ color: blue; } strong{ color: darkred; } /*id选择器*/ #pid{ color:firebrick; } #divid p{ color: #98bf21; } /*class选择器*/ .pclass{ color: chartreuse; } .divclass p{ color:sandybrown; font-size: 20px; } /*css盒子模型——内边距*/ #tdid{ padding-left: 100px; padding-right: 50px; padding-top: 30px; padding-bottom: 70px; } /*CSS盒子模型——边框*/ #bkid{ border-style: double; border-top-style: dashed; border-left-style: groove; border-bottom-width: 20px; border-color: purple; } /*圆角边框*/ #radiusid{ border-radius: 10px; width: 200px; background-color: deepskyblue; text-align: center; border: 2px solid blue; } /*css阴影效果*/ .cssid { background-color: #A7C942; width: 100px; height: 100px; text-align: center; box-shadow: 10px 10px 1px #ffccff ; } /*css外边距*/ .mg{ background-color: aquamarine; width: 100px; height:100px; margin-top: 20px; } /*盒子模型实例*/ body{ margin: 0; /* 此处是将盒子距离页面最左最右距离变为0*/ } .container{ margin: 100px; } .bd{ border-style: double; } .pd{ padding: 100px; } .content{ background-color: maroon; } /*盒子模型应用*/ .top1{ width: 100%; height: 50px; background-color: aqua; } .top1_container{ width: 75%; height: 50px; margin: 0px auto; background-color: maroon; line-height: 50px; } .body1{ margin: 20px auto; width: 75%; height: 1500px; background-color: #ffccff; } .body1_img{ width: 100%; height: 400px; background-color: burlywood; line-height: 400px; } .body1_content{ width: 100%; height: 1100px; background-color: crimson; } .body1_inform{ width: 100%; height: 50px; background-color: darkviolet; } .footing{ width: 75%; height: 440px; background-color: hotpink; margin: 0px auto; } .footing_content{ width: 100%; height: 370px; background-color: deeppink; } .footing_menu{ width: 100%; height: 70px; background-color: black; }
最后
以上就是老实钥匙最近收集整理的关于CSS基础-盒子的全部内容,更多相关CSS基础-盒子内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复