-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
55 lines (50 loc) · 1.18 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Switcher</title>
<style>
.switcher {
width: 124px;
height: 49px;
cursor: pointer;
position: relative;
}
.switcher * {
transition: all .2s;
-moz-transition: all .2s;
-webkit-transition: all .2s;
-o-transition: all .2s;
-ms-transition: all .2s;
}
.switcher .sw_btn {
background: url('btn.png') 0% 0% no-repeat;
width: 49px;
height: 49px;
display: block;
cursor: pointer;
z-index: 1;
position: relative;
}
.switcher .bg { background: url('bg-off.png') 0% 0% no-repeat; }
.switcher input.switcher-value:checked ~ .sw_btn { margin-left: 68px; }
.switcher input.switcher-value:checked ~ .sw_btn ~ .bg { background: url('bg-on.png') 0% 0% no-repeat; }
.switcher input.switcher-value { display: none; }
.switcher .bg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
</style>
</head>
<body>
<div class="switcher">
<input id="sw" type="checkbox" class="switcher-value">
<label for="sw" class="sw_btn"></label>
<div class="bg"></div>
</div>
</body>
</html>