-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.html
318 lines (277 loc) · 9.86 KB
/
example.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Collpase and Expand</title>
<link href="https://fonts.googleapis.com/css?family=Poppins&display=swap" rel="stylesheet">
<link href="https://unpkg.com/ionicons@4.5.5/dist/css/ionicons.min.css" rel="stylesheet">
<!-- STYLE to make page look good -->
<style media="screen">
body {
font-family: 'Poppins', sans-serif;
}
.container {
max-width: 1024px;
margin: auto;
}
.row {
margin: 0 15px;
}
.col-12 {
width: calc(100% - 30px);
float: left;
padding: 15px;
}
.col-4 {
width: calc(50% - 30px);
float: left;
padding: 15px;
}
code {
background: #212121;
color: #FFF;
padding: 5px;
border-radius: 4px;
}
</style>
<!-- ACCORDION using CSS ':checked' selector -->
<style media="screen">
.accordion {
min-width: 400px;
background: #acacac;
}
.accordion label {
font-size: 1em;
font-weight: bold;
text-transform: uppercase;
padding: 1rem;
background: #f2f2f2;
cursor: pointer;
display: block;
border-bottom: 1px solid #d3d3d3;
}
.accordion label::before {
content: "\f273";
font-size: 0.75em;
font-family: 'Ionicons';
vertical-align: middle;
margin-right: 1rem;
}
.accordion .info {
display: none;
color: #FFF;
padding: 1rem;
text-align: justify;
}
.accordion input[type=checkbox] {
display: none;
}
.accordion input[type=checkbox]:checked ~ label::before {
content: "\f368";
}
.accordion input[type=checkbox]:checked ~ .info {
display: block;
}
</style>
<!-- MENU DROPDOWN LIST using CSS ':hover' selector -->
<style media="screen">
.menu-list {
min-width: 300px;
background: #acacac;
}
.menu-list .title {
font-size: 1em;
text-transform: uppercase;
padding: 1rem;
background: #f2f2f2;
position: relative;
margin: 0;
cursor: pointer;
}
.menu-list .title::after {
content: "\f27f";
font-family: 'Ionicons';
vertical-align: middle;
position: absolute;
right: 10px;
margin-left: 10px;
}
.menu-list ul {
display: none;
padding: 0;
margin: 0;
}
.menu-list ul li {
display: flex;
}
.menu-list ul li:hover {
background: #333;
}
.menu-list ul li a {
color: #FFF;
flex: auto;
text-decoration: none;
padding: 1rem;
}
.menu-list .title:hover ~ ul {
display: block;
}
.menu-list .title ~ ul:hover {
display: block;
}
</style>
<!-- BUCKET LIST using CSS ':hover' and ':checked' selector -->
<style media="screen">
.bucket-list {
min-width: 300px;
background: #acacac;
}
.bucket-list .title {
font-size: 1em;
text-transform: uppercase;
padding: 1rem;
background: #f2f2f2;
position: relative;
margin: 0;
cursor: pointer;
}
.bucket-list .title::before {
content: "\f273";
font-size: 0.75em;
font-family: 'Ionicons';
vertical-align: middle;
}
.bucket-list .title:hover::before {
content: "\f368";
}
.bucket-list ul {
display: none;
padding: 0;
margin: 0;
}
.bucket-list ul li {
display: flex;
}
.bucket-list ul li label {
color: #FFF;
display: block;
padding: 1rem;
width: 100%;
}
.bucket-list ul li label:hover {
background: #333;
cursor: pointer;
}
.bucket-list ul li input[type=checkbox] {
display: none;
}
.bucket-list ul li input[type=checkbox]:checked ~ label {
text-decoration: line-through;
}
.bucket-list .title:hover ~ ul {
display: block;
}
.bucket-list .title ~ ul:hover {
display: block;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-12">
<!-- ACCORDION using CSS ':checked' selector -->
<div class="accordion-container">
<div class="accordion">
<input type="checkbox" name="group" id="accordion1" />
<label for="accordion1">Common Selectors</label>
<div class="info">
<h4>Type Selector : Selects an element by its type.</h4>
<p>Example : <code>h1</code></p>
<h4>Class Selector : Selects an element by the class attribute value, which may be reused multiple times per page.</h4>
<p>Example : <code>.tagline</code></p>
<h4>ID Selector : Selects an element by the ID attribute value, which is unique and to only be used once per page.</h4>
<p>Example : <code>#intro</code></p>
</div>
</div>
<div class="accordion">
<input type="checkbox" name="group" id="accordion2" />
<label for="accordion2">Child Selectors</label>
<div class="info">
<h4>Descendant Selector : Selects an element that resides anywhere within an identified ancestor element.</h4>
<p>Example : <code>article h2</code></p>
<h4>Direct Child Selector : Selects an element that resides immediately inside an identified parent element.</h4>
<p>Example : <code>article > p</code></p>
</div>
</div>
<div class="accordion">
<input type="checkbox" name="group" id="accordion3" />
<label for="accordion3">Sibling Selectors</label>
<div class="info">
<h4>General Sibling Selector : Selects an element that follows anywhere after the prior element, in which both elements share the same parent.</h4>
<p>Example : <code>h2 ~ p</code></p>
<h4>Adjacent Sibling Selector : Selects an element that follows directly after the prior element, in which both elements share the same parent.</h4>
<p>Example : <code>h2 + p</code></p>
</div>
</div>
<div class="accordion">
<input type="checkbox" name="group" id="accordion4" />
<label for="accordion4">Attribute Selectors</label>
<div class="info">
<h4>Attribute Present Selector : Selects an element if the given attribute is present.</h4>
<p>Example : <code>a[target]</code></p>
<h4>Attribute Equals Selector : Selects an element if the given attribute value exactly matches the value stated.</h4>
<p>Example : <code>a[href="http://google.com/"]</code></p>
<h4>Attribute Contains Selector : Selects an element if the given attribute value contains at least once instance of the value stated.</h4>
<p>Example : <code>a[href*="login"]</code></p>
<h4>Attribute Begins With Selector : Selects an element if the given attribute value begins with the value stated.</h4>
<p>Example : <code>a[href^="https://"]</code></p>
<h4>Attribute Ends With Selector : Selects an element if the given attribute value ends with the value stated.</h4>
<p>Example : <code>a[href$=".pdf"]</code></p>
<h4>Attribute Spaced Selector : Selects an element if the given attribute value is whitespace-separated with one word being exactly as stated.</h4>
<p>Example : <code>a[rel~="tag"]</code></p>
<h4>Attribute Hyphenated Selector : Selects an element if the given attribute value is hyphen-separated and begins with the word stated.</h4>
<p>Example : <code>a[lang|="en"]</code></p>
</div>
</div>
</div>
</div>
<div class="col-4">
<!-- MENU DROPDOWN LIST using CSS ':hover' selector -->
<div class="menu-list">
<h4 class="title"> Other Repositories</h4>
<ul>
<li><a target="_blank" href="https://github.com/connect2samita">Developer Profile</a></li>
<li><a target="_blank" href="https://connect2samita.github.io/css3-selectors/">CSS3 Selectors</a></li>
<li><a target="_blank" href="https://connect2samita.github.io/gulp-automation-v3/">Gulp Automation v3</a></li>
</ul>
</div>
</div>
<div class="col-4">
<!-- BUCKET LIST using CSS ':hover' and ':checked' selector -->
<div class="bucket-list">
<h4 class="title"> Bucket List (Click to Uncheck)</h4>
<ul>
<li>
<input type="checkbox" name="group" id="group_1" checked/>
<label for="group_1">Visit Singapore</label>
</li>
<li>
<input type="checkbox" name="group" id="group_2" />
<label for="group_2">Ride a Horse</label>
</li>
<li>
<input type="checkbox" name="group" id="group_3" />
<label for="group_3">Go Scuba Diving</label>
</li>
<li>
<input type="checkbox" name="group" id="group_3" />
<label for="group_3">Go Sky Diving</label>
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>