-
Notifications
You must be signed in to change notification settings - Fork 0
/
07动画.html
62 lines (53 loc) · 1.22 KB
/
07动画.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
.box {
width: 200px;
height: 200px;
background-color: pink;
/* 调用动画集 */
/* animation: move 1s infinite linear alternate; */
animation: move 5s linear;
}
@keyframes move {
0% {
transform: translateX(0px);
width: 200px;
height: 200px;
}
40% {
width: 300px;
height: 300px;
}
80% {
width: 200px;
height: 200px;
transform: translateX(100px);
}
100% {
transform: translateX(0px);
width: 200px;
height: 200px;
}
}
/* 定义动画集 */
@keyframes move1 {
from {
/* 动画的开始状态 */
/* 位置开始状态 */
transform: translateX(0px);
}
to {
/* 动画的结束状态 */
/* 位置结束状态 */
transform: translateX(300px);
}
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>