/
button11.html
65 lines (65 loc) · 1.43 KB
/
button11.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Button 11</title>
<style>
body {
margin: 0;
padding: 0;
background: #ffffff;
}
.container {
position: absolute;
top: calc(50% - 25px);
left: calc(50% - 77px);
transform: translate(-50%, -50%);
}
a {
position: relative;
text-decoration: none;
text-transform: uppercase;
font-size: 22px;
font-family: sans-serif;
letter-spacing: 4px;
transition: .5s;
transform-style: preserve-3d;
}
a::before,
a::after {
content: attr(title);
position: absolute;
top: 0;
left: 0;
padding: 10px 20px;
box-shadow: 0 0 0 1px #000;
transition: .5s;
}
a::before {
color: #000;
background: #fff;
transform: translateX(-100%) rotateY(90deg);
transform-origin: right;
}
a::after {
color: #fff;
background: #000;
transform: translateX(0) rotateY(0deg);
transform-origin: left;
}
a:hover::before {
transform: translateX(0) rotateY(0deg);
}
a:hover::after {
transform: translateX(100%) rotateY(90deg);
}
</style>
</head>
<body>
<div class="container">
<a href="#" title="Button" class="btn"></a>
</div>
</body>
</html>