CSS 日常练习----box-shadow

记录日常 CSS 练习的小知识点 —— box-shadow

box-shadow

点击预览

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>box-shadow练习</title>
<style>
.mohu1{
width: 200px;
height: 200px;
background: #000;
box-shadow: 0 0 200px red;
margin: 200px auto;
}
.mohu2{

width: 200px;
height: 200px;
background: #000;
box-shadow: 0px 0px 10px 20px red;
margin: 200px auto;
}
.mohu3{
width: 200px;
height: 200px;
background: #000;
box-shadow: 0px 0px 10px 10px red;
margin: 200px auto;
}
.mohu4{
width: 200px;
height: 200px;
background: #000;
box-shadow: 0px 0px 10px 10px red;
margin: 200px auto;
}
.mohu5{
width: 200px;
height: 200px;
background: #000;
box-shadow: 10px 10px 10px red,0px 0px 20px 10px yellow ;
margin: 200px auto;
}
.mohu6{
width: 200px;
height: 200px;
background: rgba(255,255,255,0.4);
box-shadow: 10px 10px 10px red,0px 0px 20px 10px yellow ;
margin: 200px auto;
}
.mohu7{
width: 200px;
height: 200px;
background: greenyellow;
box-shadow: 10px 10px 10px red;
margin: 40px auto;
}
.mohu8{
width: 200px;
height: 200px;
background: greenyellow;
box-shadow: 10px 10px 20px -10px red;
margin: 40px auto;
}
</style>
</head>
<body>
<div class="mohu1">模糊半径的值</div>
<div class="mohu2">扩展半径1</div>
<div class="mohu3">扩展半径2</div>
<div class="mohu4">扩展半径3</div>
<div class="mohu5">多层阴影效果</div>

<div class="mohu6">半透明背景下的阴影效果</div>

<div class="mohu7">邻边投影:方法一</div>

<div class="mohu8">邻边投影:方法二</div>
<script>
console.log('ddd');
</script>
</body>
</html>
0%