-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
67 lines (57 loc) · 1.24 KB
/
styles.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
height: 100vh;
font-size: 16px;
font-family: Arial, Helvetica, sans-serif;
background-color: #555;
}
.btn {
position: relative;
display: inline-block;
margin: auto;
padding: 12px 60px;
border: 2px solid #000;
font-size: 1.2rem;
text-decoration: none;
letter-spacing: 2px;
color: #000;
overflow: hidden;
z-index: 10;
background-color: #fff;
}
.btn::after {
position: absolute;
top: 0;
left: 0;
content: "";
width: 0%;
height: 100%;
background-color: red;
-webkit-transform: translate(-100%);
transform: translate(-100%);
z-index: -1;
}
.btn:hover::after {
-webkit-animation: 1.5s translateLeft forwards infinite ;
animation: 1.5s translateLeft forwards infinite ;
width: 100%;
}
@-webkit-keyframes translateLeft {
100% {
-webkit-transform: translate(100%);
transform: translate(100%);
}
}
@keyframes translateLeft {
100% {
-webkit-transform: translate(100%);
transform: translate(100%);
}
}