-
Notifications
You must be signed in to change notification settings - Fork 287
/
images.html
90 lines (76 loc) · 2.14 KB
/
images.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
<!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-left: -1.2em;
width: 1em;
height: 1em;
background-image: url(images/off.svg);
}
/* Checked */
.check__input:checked + .check__box {
background-image: url(images/on.svg);
}
/* Focused */
.check__input:focus + .check__box {
background-image: url(images/off-focused.svg);
}
.check__input:checked:focus + .check__box {
background-image: url(images/on-focused.svg);
}
/* Disabled */
.check__input:disabled + .check__box {
background-image: url(images/off-disabled.svg);
}
.check__input:checked:disabled + .check__box {
background-image: url(images/on-disabled.svg);
}
</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>