-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnimationTut2.html
60 lines (59 loc) · 1.42 KB
/
AnimationTut2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Animation Tut-2</title>
<style>
div {
padding: 1rem;
width: 100px;
height: 100px;
font-size: larger;
font-family: "Times New Roman", Times, serif;
font-weight: 700;
font-style: oblique;
background-color: red;
color: aliceblue;
position: relative;
animation-name: boxani;
animation-duration: 5s;
}
@keyframes boxani {
0% {
background-color: red;
left: 0px;
top: 0px;
}
25% {
background-color: blueviolet;
left: 200px;
top: 0px;
}
50% {
background-color: green;
left: 200px;
top: 200px;
}
75% {
background-color: rgb(20, 220, 153);
left: 0px;
top: 200px;
}
100% {
background-color: red;
left: 0px;
top: 0px;
}
}
</style>
</head>
<body>
<h1>CSS Animations</h1>
<div>I'm an animated box.</div>
<p>
When the animation is finished, it will go back to it's original form.
</p>
</body>
</html>