-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC8_S2_Demos.txt
425 lines (368 loc) · 10.9 KB
/
C8_S2_Demos.txt
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
Ex1 : headers-semantic
======================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Semantic Headers</title>
</head>
<body>
<h1>List of World's Top Things</h1>
<h2>Top 5 Programming Language</h2>
<ol>
<li>TypeScript</li>
<li>JavaScript</li>
<li>Python</li>
<li>Java</li>
<li>CSharp</li>
</ol>
<h2>Top 5 Fashion Brands</h2>
<ol>
<li>Zara</li>
<li>Tommy Hilfiger</li>
<li>Arrow</li>
<li>Allen Solley</li>
<li>Raymond</li>
</ol>
<h2>Top 5 Monuments</h2>
<ol>
<li>Lincoln Memorial</li>
<li>Eifell Tower</li>
<li>Taj Mahal</li>
<li>Pyramids of Giza</li>
<li>Staue of Liberty</li>
</ol>
</body>
</html>
=========================================================================
Ex2: headers-non-semantic
=========================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Non-semantic Headers</title>
<style>
.h1 {
font-size: 2em;
font-weight: bold;
margin-block-start: 0.67em;
margin-block-end: 0.67em;
}
.h2 {
font-size: 1.5em;
font-weight: bold;
margin-block-start: 0.83em;
margin-block-end: 0.83em;
}
</style>
</head>
<body>
<div class="h1">List of World's Top Things</div>
<div class="h2">Top 5 Programming Language</div>
<ol>
<li>TypeScript</li>
<li>JavaScript</li>
<li>Python</li>
<li>Java</li>
<li>CSharp</li>
</ol>
<div class="h2">Top 5 Fashion Brands</div>
<ol>
<li>Zara</li>
<li>Tommy Hilfiger</li>
</ol>
<div class="h2">Top 5 Monuments</div>
<ol>
<li>Taj Mahal</li>
</ol>
</body>
</html>
=================================================================
EX3: buttons-and-links
==========================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Button and Links</title>
</head>
<body>
<h3>Observe and check whether buttons or links should be used</h3>
See <a href="https://webaim.org/intro/" rel="noopener">WebAIM's Introduction to Web Accessibility</a> for more information.
<br><br>
<nav>
<button>About</button>
<button>Services</button>
<button>Work</button>
<button>Contact</button>
</nav>
<br>
<a href="#" onclick="openDialog()">Open dialog box </a>
<p>Do you want to log in?</p>
<button>Log In</button>
</body>
</html>
=====================================================================
Ex4 : semantic-elements
==========================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Semantic HTML5 elements</title>
<style>
.heading {
text-align: center;
}
ul {
background-color: #eee;
height: 40px;
padding: 10px;
}
li {
display: inline;
}
</style>
</head>
<body>
<header>
<nav>
<ul>
<li>
<img src="images/umbrella-logo.jpg" width="80px" height="40px" alt=" logo " />
</li>
<li>
<a href="index.html ">Home</a>
</li>
<li>
<a href="services.html ">Services</a>
</li>
<li>
<a href="contact.html ">Contact</a>
</li>
<li>
<a href="about.html ">About Us</a>
</li>
</ul>
</nav>
</header>
<main>
<article>
<section>
<h1>Climate Strikes: Rapid Action Needed to Stop Environmental Catastrophe
</h1>
<p>Saving the world is not an easy job, but cutting greenhouse gas emissions and limiting climate change is action the planet urgently needs, say scientists.</p>
</section>
<section>
<h1>Finding the Oldest Tree in the World</h1>
<p>One of the best aspects of working in California is the immense diversity that exists in the natural world, and how often I am surprised to find some other, new, and magnificent subject matter to photograph! This is exactly the case of
the Ancient Bristlecone Pine Forest, located in the White Mountains of Inyo National Forest.</p>
</section>
</article>
<details>
<summary>Contact Us</summary>
<p>Do you have a question or complaint about a TV rating or wish to learn more about the TV Parental Guidelines and its oversight?
</p>
</details>
<aside>
<p>Viewed by 6303 people</p>
<p>Author: Ken Thompson, Senior technical specialist at Google, Mountain View, California</p>
<figure>
<img src=" images/john.jpeg " alt="John Doe " width="70px " height="70px " />
<img src="images/maggie.jpeg " alt="Maggie Smith " width="70px " height="70px " />
<figcaption>People who liked the article</figcaption>
</figure>
</aside>
</main>
<footer>
<small>
©Global Welfare Fund
<time datetime="2019-10-19T11:21:00+02:00 ">Saturday, 19 October 2019</time>
</small>
</footer>
</body>
</html>
Note : You have to create image folder and store john.jpeg, maggie.jpeg,umbrella-logo.jpg
========================================================================
EX5: navlinks-semantic-elements
================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Semantic NavLinks</title>
<style>
h1 {
text-align: center;
}
ul {
background-color: #eee;
height: 30px;
padding: 10px;
}
li {
display: inline;
}
</style>
</head>
<body>
<header>
<h1>Protect the World</h1>
<nav>
<ul>
<li>
<a href="index.html ">Home</a>
</li>
<li>
<a href="services.html ">Services</a>
</li>
<li>
<a href="contact.html ">Contact</a>
</li>
<li>
<a href="about.html ">About Us</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
===================================================================
EX6: links-non-semantic-elements
===============================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Non-Semantic Link elements</title>
<style>
.h1 {
font-size: 2em;
font-weight: bold;
margin-block-start: 0.67em;
margin-block-end: 0.67em;
text-align: center;
}
.navigation {
background-color: #eee;
height: 30px;
padding: 10px;
}
</style>
</head>
<body>
<div>
<div class="h1">Protect the world</div>
<div class="navigation">
<a href="index.html">Home</a>
<a href="services.html">Services</a>
<a href="contact.html">Contact</a>
<a href="about.html">About Us</a>
</div>
</div>
</body>
</html>
==========================================================
Ex7: button-and-div
=====================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Button and Div Elements</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<button class="btn"><button> button</button>
<div class="btn" tabindex="0"><div> button</div>
<p class="output">Waiting for a click...</p>
<script src="script.js"></script>
</body>
</html>
This code requires two additional file so create script.js and style.css
script.js :
===========
const buttonButton = document.querySelector('button.btn');
const divButton = document.querySelector('div.btn');
const output = document.querySelector('.output');
function logClick() {
output.textContent = 'I heard a click! Resetting in 1 second...';
setTimeout(function() {
output.textContent = 'Waiting for a click...';
}, 1000);
}
buttonButton.addEventListener('click', logClick);
divButton.addEventListener('click', logClick);
style.css:
==========
body {
font-family: "Benton Sans", "Helvetica Neue", helvetica, arial, sans-serif;
margin: 2em;
}
.instructions {
margin: 8px;
}
.btn {
display: inline-block;
font-family: monospace;
font-size: 16px;
border: 2px solid black;
border-radius: 8px;
background: transparent;
padding: 8px;
margin: 0 8px;
user-select: none;
}
.btn:hover {
background: #f8bbd0;
}
.btn:active {
background: #880e4f;
color: white;
}
========================================================================
EX8: aria-attributes-close-button
=================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aria Attributes for Close Button</title>
</head>
<body>
<div id="box">
This is a pop-up box.
<button aria-label="Close" onclick="document.getElementById('box').style.display='none';" class="close-button">X</button>
</div>
</body>
</html>
==================================================================
EX9: aria-attributes-search
===========================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Box with ARIA labels</title>
</head>
<body>
<form id="search" role="search" aria-label="site-wide">
<label for="search-input">Search this site</label>
<input type="search" id="search-input" name="search" spellcheck="false">
<input value="Submit" type="submit">
</form>
</body>
</html>
=========================================================================