123button {4 padding: 0.8em 1.8em;5 border: 2px solid #fff;6 position: relative;7 overflow: hidden;8 background-color: #fff;9 text-align: center;10 text-transform: uppercase;11 font-size: 18px;12 transition: .3s;13 z-index: 1;14 font-family: inherit;15 color: #000;16 border-radius: 30px;17 box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;18}19button::after {20 content: "";21 width: 0;22 height: 100%;23 position: absolute;24 top: 0;25 right: 0;26 background-color: red;27 text-align: center;28 display: flex;29 align-items: center;30 justify-content: center;31 transition: all 800ms ease-in-out;32 z-index: -1;33 opacity: 80%;34}35button::before {36 content: "";37 width: 0;38 height: 100%;39 position: absolute;40 left: 0;41 top: 0;42 background-color: blue;43 display: flex;44 align-items: center;45 justify-content: center;46 transition: all 800ms ease-in-out;47 z-index: -1;48 opacity: 60%;49}50button:hover::after {51 width: 37.5%;52}53button:hover::before {54 width: 37.5%;55}
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
button {
padding: 0.8em 1.8em;
border: 2px solid #fff;
position: relative;
overflow: hidden;
background-color: #fff;
text-align: center;
text-transform: uppercase;
font-size: 18px;
transition: .3s;
z-index: 1;
font-family: inherit;
color: #000;
border-radius: 30px;
box-shadow: rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px, rgba(10, 37, 64, 0.35) 0px -2px 6px 0px inset;
}
button::after {
content: "";
width: 0;
height: 100%;
position: absolute;
top: 0;
right: 0;
background-color: red;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
transition: all 800ms ease-in-out;
z-index: -1;
opacity: 80%;
}
button::before {
content: "";
width: 0;
height: 100%;
position: absolute;
left: 0;
top: 0;
background-color: blue;
display: flex;
align-items: center;
justify-content: center;
transition: all 800ms ease-in-out;
z-index: -1;
opacity: 60%;
}
button:hover::after {
width: 37.5%;
}
button:hover::before {
width: 37.5%;
}
You need to sign in before you can write a comment.