You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<title>Hold Shift to Check Multiple Checkboxes</title>
5
+
<metacharset="UTF-8">
6
+
<title>Hold Shift to Check Multiple Checkboxes</title>
6
7
</head>
7
-
<body>
8
-
<style>
9
-
10
-
html {
11
-
font-family: sans-serif;
12
-
background:#ffc600;
13
-
}
14
-
15
-
.inbox {
16
-
max-width:400px;
17
-
margin:50px auto;
18
-
background:white;
19
-
border-radius:5px;
20
-
box-shadow:10px10px0rgba(0,0,0,0.1);
21
-
}
22
-
23
-
.item {
24
-
display:flex;
25
-
align-items:center;
26
-
border-bottom:1px solid #F1F1F1;
27
-
}
28
-
29
-
.item:last-child {
30
-
border-bottom:0;
31
-
}
32
8
33
-
34
-
input:checked+p {
35
-
background:#F9F9F9;
36
-
text-decoration: line-through;
37
-
}
38
-
39
-
input[type="checkbox"] {
40
-
margin:20px;
41
-
}
42
-
43
-
p {
44
-
margin:0;
45
-
padding:20px;
46
-
transition:background 0.2s;
47
-
flex:1;
48
-
font-family:'helvetica neue';
49
-
font-size:20px;
50
-
font-weight:200;
51
-
border-left:1px solid #D1E2FF;
52
-
}
53
-
54
-
55
-
</style>
56
-
<!--
9
+
<body>
10
+
<style>
11
+
html {
12
+
font-family: sans-serif;
13
+
background:#ffc600;
14
+
}
15
+
16
+
.inbox {
17
+
max-width:400px;
18
+
margin:50px auto;
19
+
background: white;
20
+
border-radius:5px;
21
+
box-shadow:10px10px0rgba(0,0,0,0.1);
22
+
}
23
+
24
+
.item {
25
+
display: flex;
26
+
align-items: center;
27
+
border-bottom:1px solid #F1F1F1;
28
+
}
29
+
30
+
.item:last-child {
31
+
border-bottom:0;
32
+
}
33
+
34
+
input:checked+p {
35
+
background:#F9F9F9;
36
+
text-decoration: line-through;
37
+
}
38
+
39
+
input[type="checkbox"] {
40
+
margin:20px;
41
+
}
42
+
43
+
p {
44
+
margin:0;
45
+
padding:20px;
46
+
transition: background 0.2s;
47
+
flex:1;
48
+
font-family:'helvetica neue';
49
+
font-size:20px;
50
+
font-weight:200;
51
+
border-left:1px solid #D1E2FF;
52
+
}
53
+
</style>
54
+
<!--
57
55
The following is a common layout you would see in an email client.
58
56
59
57
When a user clicks a checkbox, holds Shift, and then clicks another checkbox a few rows down, all the checkboxes inbetween those two checkboxes should be checked.
60
58
61
59
-->
62
-
<divclass="inbox">
63
-
<divclass="item">
64
-
<inputtype="checkbox">
65
-
<p>This is an inbox layout.</p>
60
+
<divclass="inbox">
61
+
<divclass="item">
62
+
<inputtype="checkbox">
63
+
<p>This is an inbox layout.</p>
64
+
</div>
65
+
<divclass="item">
66
+
<inputtype="checkbox">
67
+
<p>Check one item</p>
68
+
</div>
69
+
<divclass="item">
70
+
<inputtype="checkbox">
71
+
<p>Hold down your Shift key</p>
72
+
</div>
73
+
<divclass="item">
74
+
<inputtype="checkbox">
75
+
<p>Check a lower item</p>
76
+
</div>
77
+
<divclass="item">
78
+
<inputtype="checkbox">
79
+
<p>Everything inbetween should also be set to checked</p>
80
+
</div>
81
+
<divclass="item">
82
+
<inputtype="checkbox">
83
+
<p>Try do it with out any libraries</p>
84
+
</div>
85
+
<divclass="item">
86
+
<inputtype="checkbox">
87
+
<p>Just regular JavaScript</p>
88
+
</div>
89
+
<divclass="item">
90
+
<inputtype="checkbox">
91
+
<p>Good Luck!</p>
92
+
</div>
93
+
<divclass="item">
94
+
<inputtype="checkbox">
95
+
<p>Don't forget to tweet your result!</p>
96
+
</div>
66
97
</div>
67
-
<divclass="item">
68
-
<inputtype="checkbox">
69
-
<p>Check one item</p>
70
-
</div>
71
-
<divclass="item">
72
-
<inputtype="checkbox">
73
-
<p>Hold down your Shift key</p>
74
-
</div>
75
-
<divclass="item">
76
-
<inputtype="checkbox">
77
-
<p>Check a lower item</p>
78
-
</div>
79
-
<divclass="item">
80
-
<inputtype="checkbox">
81
-
<p>Everything inbetween should also be set to checked</p>
0 commit comments