-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoggle-switch-checkbox.html
91 lines (90 loc) · 2.11 KB
/
toggle-switch-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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Toggle Switch CheckBox</title>
<style>
.wrapper{
margin: 150px auto;
padding: 10px;
width: 450px;
height: 250px;
background: hotpink;
}
.gitLabel {
display: block;
width: 60px;
height: 30px;
margin-bottom: 15px;
position: relative;
}
.gitLabel input{
display: none;
}
.switch {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: grey;
border-radius: 20px;
transition: all 0.3s ease;
}
.switch::after{
content: "";
width: 28px;
height: 28px;
background: whitesmoke;
border-radius: 100vh;
position: absolute;
top: 1px;
left: 1px;
transition: all 0.3s ease;
}
input:checked+.switch{
background:springgreen;
}
input:checked+.switch::after{
transform: translateX(30px);
}
p{
position: relative;
top: 5px;
color: #222;
margin-left: 65px;
font-size: 18px;
}
</style>
</head>
<body>
<div class="wrapper">
<h1>Choose your Account Type:</h1>
<div class="gitLabel"">
<input type="checkbox" name="coding" id="github" />
<div class="switch"></div>
<label class="gitLabel" for="github">
<p >GitHub</p>
</label
>
</div>
<div class="gitLabel"">
<input type="checkbox" name="coding" id="linkedin" />
<div class="switch"></div>
<label class="gitLabel" for="linkedin">
<p >LinedIn</p>
</label
>
</div>
<div class="gitLabel"">
<input type="checkbox" name="coding" id="twitter" />
<div class="switch"></div>
<label class="gitLabel" for="twitter">
<p >Twitter</p>
</label
>
</div>
</div>
</body>
</html>