forked from coder2hacker/Explore-open-source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckbox.html
71 lines (60 loc) · 1.06 KB
/
checkbox.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>checkbox</title>
<style>
body
{
margin: 0;
padding: 0;
background: #f3f3f3;
}
.main
{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
input[type="checkbox"]
{
position: relative;
height: 80px;
width: 160px;
-webkit-appearance: none;
background: #c6c6c6;
outline: none;
border-radius: 40px;
box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
transition: .5s;
}
input:checked[type="checkbox"]{
background: #03a9f4;
}
input[type="checkbox"]:before
{
content: '';
position: absolute;
background: #fff;
height: 80px;
width: 80px;
border-radius: 40px;
top: 0;
left: 0;
transition: .5s;
transform: scale(1.1);
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input:checked[type="checkbox"]:before
{
left: 80px;
}
</style>
</head>
<body>
<div class="main">
<input type="checkbox" name="">
</div>
</body>
</html>