-
Notifications
You must be signed in to change notification settings - Fork 287
/
styles.html
95 lines (82 loc) · 2.27 KB
/
styles.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
92
93
94
95
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Чекбокс: Стили</title>
<style>
body {
margin: 0;
padding: 25px;
font-family: sans-serif;
}
/* Option */
.option {
display: block;
margin-bottom: 0.5em;
}
/* Check */
.check {
padding-left: 1.2em;
}
.check__input {
position: absolute;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.check__box {
position: absolute;
margin-top: 0.2em;
margin-left: -1em;
width: 0.6em;
height: 0.6em;
overflow: hidden;
border-radius: 0.05em;
background-color: white;
background-repeat: no-repeat;
background-position: 50% 50%;
box-shadow: 0 0 0 0.1em #4A90E2;
}
/* Checked */
.check__input:checked + .check__box {
background-color: #4A90E2;
background-image: url(images/check.svg);
}
/* Focused */
.check__input:focus + .check__box {
box-shadow:
0 0 0 0.1em #4A90E2,
0 0 0 0.2em #7ED321;
}
/* Disabled */
.check__input:disabled + .check__box {
box-shadow: 0 0 0 0.1em #9B9B9B;
}
.check__input:checked:disabled + .check__box {
background-color: #9B9B9B;
}
</style>
</head>
<body>
<label class="check option">
<input class="check__input" type="checkbox">
<span class="check__box"></span>
Первый
</label>
<label class="check option">
<input class="check__input" type="checkbox" checked>
<span class="check__box"></span>
Второй
</label>
<label class="check option">
<input class="check__input" type="checkbox" disabled>
<span class="check__box"></span>
Третий
</label>
<label class="check option">
<input class="check__input" type="checkbox" checked disabled>
<span class="check__box"></span>
Четвёртый
</label>
</body>
</html>