-
Notifications
You must be signed in to change notification settings - Fork 0
/
07_keyframes.html
59 lines (49 loc) · 1.54 KB
/
07_keyframes.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Keyframes</title>
<style>
body {
background: #333;
}
.box {
background: white;
width: 200px;
height: 200px;
/* When you add position: relative, you can add
porameters like, top, bottom, left, and right */
position: relative;
/* Can combine All of this into animation */
/*(( animation-name: animate1;
animation-duration: 5s;
// animation-iteration-count: infinite; //
animation-iteration-count: 1;
animation-fill-mode: forwards;
animation-delay: 2s;
// animation-direction: alternate-reverse; //
animation-direction: alternate;
// animation-timing-function: ease-out; /
// animation-timing-function: ease-in; //
animation-timing-function: ease-in-out; ))*/
/* first: name | second: duration/speed | third: fill mode (forwards = stop at the end) | fourth: delay | fifth: timing function */
animation: animate1 5s forwards 1s ease-in;
}
@keyframes animate1 {
from {
width: 200px;
top: 0;
}
to {
width: 600px;
background-color: red;
top: 300px;
}
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>