如何用CSS画一只电老鼠

不知道大家有没有去看大侦探皮卡丘呀,有没有被银幕上毛茸茸的电老鼠萌到呢?现在我就来用CSS画一只简易版的皮卡丘吧。(希望不会收到东半球最强法务部的律师函)

img

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div class="main">   
<div class="head">
<div class="ear left"></div>
<div class="ear right"></div>
<div class="eye left"></div>
<div class="eye right"></div>
<div class="face left"></div>
<div class="face right"></div>
<div class="mouth"></div>
</div>
<div class="ball">
<div class="belt">
<div class="lock">
<div class="but">
</div>
</div>
<div class="light"></div>
</div>
</div>
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
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.main{
position: relative;
}
.ear.left{
background: #ffe000;
width:40px;
height:90px;
position: absolute;
top:-44px;
left:0;
border-radius: 20px 20px 20px 20px/70px 070px 20px 20px;
transform: rotate(-30deg);
display: flex;
justify-content: center;
overflow: hidden;
}
.ear.left::after{
content: "";
display: block;
width:30px;
height:20px;
background: #4E4700;
border-radius: 15px 15px 20px 20px/70px 70px 20px 20px;
}
.ear.right{
background:#ffe000;
width:40px;
height:90px;
position: absolute;
top:-44px;
right:0;
border-radius: 20px 20px 20px 20px/70px 070px 20px 20px;
transform: rotate(35deg);
display: flex;
justify-content: center;
overflow: hidden;
}
.ear.right::after{
content: "";
display: block;
width:30px;
height:20px;
background: #4E4700;
border-radius: 15px 15px 20px 20px/70px 70px 20px 20px;
}
.eye{
background: #4E4700;
width: 23px;
height: 23px;
border-radius: 23px;
}
.eye.left{
position: absolute;
left:38px;
top:44px;
}
.eye.right{
position: absolute;
right:38px;
top:44px;
}
.mouth::before{
content: '';
display: block;
width: 10px;
height: 10px;
border: 3px solid #4E4700;
border-top:none;
border-right: none;
border-bottom-left-radius: 10px ;
transform: rotateZ(-23deg);
position: absolute;
top:60px;
left:86px;
}
.mouth::after{
content: '';
display: block;
width: 10px;
height: 10px;
border: 3px solid #4E4700;
border-top: none;
border-left: none;
border-bottom-right-radius: 10px;
transform: rotateZ(23deg);
position: absolute;
top:60px;
right:86px;
}
.head{
border-radius: 200px 200px 0 0;
width:200px;
height:100px;
background:#ffe000;
}
.face{
background:#FF9900;
width:30px;
height: 30px;
border-radius: 30px;
}
.face.left{
position: absolute;
left:18px;
bottom:101px;;
}
.face.right{
position: absolute;
right:18px;
bottom:101px;
}
.ball{
border-radius:0 0 200px 200px;
width:200px;
height:100px;
background:#FF0000;
}
.belt{
width:200px;
height:15px;
background:#322221;
border-radius:0 0 2px 2px/0 0 15px 15px;
display: flex;
justify-content: center;
}
.lock{
border-radius: 0 0 80px 80px;
width:80px;
height:40px;
background:#322221;

}
.lock::after{
content: "";
display:block;
border-radius: 0 0 60px 60px;
width:60px;
height:30px;
background:#FDFDFD;
transform: translateX(10px);
}
.but{
content: "";
display:block;
border-radius: 0 0 40px 40px;
width:40px;
height:20px;
background:#322221;
transform: translateX(20px);
position: absolute;
z-index: 10;
}
.but::after{
content: "";
display:block;
border-radius: 0 0 20px 20px;
width:20px;
height:10px;
background:#686160;
transform: translateX(10px);
}
.light{
background:#FFD7C9;
width: 20px;
height: 27px;
border-radius: 10px 10px 10px 10px/15px 15px 10px 10px;
position: absolute;
top:150px;
left:150px;
transform: rotate(45deg);
}
0%