-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrick1.css
47 lines (45 loc) · 825 Bytes
/
trick1.css
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
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center ;
margin: 0;
height: 70vh;
background-color: crimson;
}
div{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
div > b{
color:#ffff;
font-size: 25px;
margin: 20px 0;
}
/* main part for bouncing */
div > h2{
color:springgreen;
font-size: 32px;
animation: bounce 3s infinite ease-in-out; /*bounce effect*/
}
/* use @keyframe for animation*/
@keyframes bounce {
0%, 100% {
transform: translateY(0); /* Start and end position */
}
25% {
transform: translateY(-20px); /* First bounce */
}
50% {
transform: translateY(0); /* Back to start */
}
75% {
transform: translateY(-10px); /* Second bounce */
}
}