-
Notifications
You must be signed in to change notification settings - Fork 0
/
ios-checkbox.html
65 lines (58 loc) · 1.21 KB
/
ios-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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.container {
box-sizing: border-box;
width: 400px;
height: 400px;
box-shadow: 0 0 25px purple;
margin: 50px auto;
padding: 100px;
text-align: center;
}
label {
width: 50px;
height: 30px;
box-sizing: border-box;
background-color: white;
border-radius: 50px;
display: inline-block;
border: 1px solid rgb(217, 218, 220);
position: relative;
transition: 0.5s;
}
label span {
width: 26px;
height: 26px;
position: absolute;
border-radius: 50px;
box-shadow: 0 5px 10px rgb(190, 190, 190);
top: 0;
bottom: 0;
margin: auto;
left: 1px;
transition: 0.5s;
}
input:checked ~ label {
box-shadow: inset 20px 0 0 0 rgb(48, 243, 75);
border-color: rgb(48, 243, 75);
}
input:checked ~ label span {
left: 21px;
}
input {
display: none;
}
</style>
</head>
<body>
<div class="container">
<h1>ios switch</h1>
<input type="checkbox" name="" id="ios-switch">
<label for="ios-switch"><span></span></label>
</div>
</body>
</html>