-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbtnhover.html
86 lines (78 loc) · 1.5 KB
/
btnhover.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Button hover effect</title>
<style>
body {
margin: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #000000;
}
ul {
padding: 0;
list-style-type: none;
}
li {
font-size: 25px;
width: 8em;
height: 2em;
color: #f4bf04;
border-left: 0.08em solid;
position: relative;
margin-top: 0.8em;
cursor: pointer;
}
li::before,
li::after
{
content: '';
position: absolute;
width: inherit;
border-left: inherit;
z-index: -1;
}
li::before {
height: 80%;
top: 10%;
left: calc(-0.15em - 0.08em * 2);
filter: brightness(0.8);
}
li::after {
height: 60%;
top: 20%;
left: calc(-0.15em * 2 - 0.08em * 3);
filter: brightness(0.6);
}
li span {
position: relative;
height: 120%;
top: -10%;
box-sizing: border-box;
border: 0.08em solid;
background-color: #0e0e0e;
display: flex;
align-items: center;
justify-content: center;
font-family: sans-serif;
text-transform: capitalize;
transform: translateX(calc(-0.15em * 3 - 0.08em * 2));
transition: 0.3s;
}
li:hover span {
transform: translateX(0.15em);
}
</style>
</head>
<body>
<ul>
<li><span>home</span></li>
<li><span>products</span></li>
<li><span>services</span></li>
<li><span>contact</span></li>
</ul>
</body>
</html>