-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSSExer.html
400 lines (388 loc) · 20.2 KB
/
CSSExer.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ad sense tag-->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1733919132650092"
crossorigin="anonymous"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FBJL1SB5QM"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-FBJL1SB5QM');
</script>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description"
content="CodingNation provides exercises to pratice and learn coding. Coding Nation Execise are used to enhance your coding skills">
<meta name="keywords"
content="coding, programming, tutorial, learn, HTML, CSS, JavaScript, Python, resources, free, code tutorial, coding exercises, coding challenges, learn to code, coding skills">
<meta name="author" content="coding-nation">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="index, follow">
<link rel="icon" type="image/png" sizes="32x32" href="../images/favicon.png">
<title>CSS Exercise</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous" />
<link rel="stylesheet" href="../Styles/Exercise.css">
<style>
</style>
</head>
<body>
<!--navigation bar-->
<header class="fixed-navbar">
<!--navigation bar-->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="../index.html">CodingNation</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto" id="navbarNavLinks">
<li class="nav-item">
<a class="nav-link" href="../index.html">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
aria-controls="navbarNav" aria-expanded="false"
aria-label="Toggle navigation">Courses</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="../Python.html">Python</a>
</li>
<li>
<a class="dropdown-item" href="../React.html">React JS</a>
</li>
<li>
<a class="dropdown-item" href="../html.html">HTML</a>
</li>
<li><a class="dropdown-item" href="../css.html">CSS</a></li>
<li>
<a class="dropdown-item" href="../jascri.html">JavaScript</a>
</li>
<li><a class="dropdown-item" href="../cpro.html">C</a></li>
<li>
<a class="dropdown-item" href="../java.html">Java</a>
</li>
<li><a class="dropdown-item" href="../php.html">PHP</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button"
data-bs-toggle="dropdown">Practice</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="../HTMLQuiz.html" target="_blank">HTML Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../CSSQuiz.html" target="_blank">CSS Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../JSQuiz.html" target="_blank">JavaScript Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../CQuiz.html" target="_blank">C Quiz</a>
</li>
<li>
<a class="dropdown-item" href="../JAVAQuiz.html" target="_blank">Java Quiz</a>
</li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button"
data-bs-toggle="dropdown">Exercises</a>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="../HTMLExer.html" target="_blank">HTML Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../CSSExer.html" target="_blank">CSS Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../JsExer.html" target="_blank">JavaScript
Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../CExer.html" target="_blank">C Exercise</a>
</li>
<li>
<a class="dropdown-item" href="../JAVAExer.html" target="_blank">Java Exercise</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="../codebot.html" target="_blank">CodeBot</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../Editor.html" target="_blank">Editor</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../About.html">About</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<h1 class="float-start">Exercise</h1>
<p id="title"></p>
<div class="questions" id="questions"></div>
<div class="bt">
<button type="submit" id="submit">Submit</button>
<button id="next">Next</button>
<button id="wrong">Try Again</button>
<button id="showAnswer">Show Answer</button>
</div>
</div>
<!-- Footer Section -->
<footer class="container-fluid text-center">
<hr />
<span class="bi bi-caret-up" onclick="topFunction()"></span>
<p>Copyright © 2023 CodingNation. All rights reserved. <br /></p>
<p>
Trademark ™ CodingNation
<a href="https://www.coding-nation.com/">www.coding-nation.com</a>
</p>
</footer>
<script>
const submit = document.getElementById("submit");
const next = document.getElementById("next");
const wrong = document.getElementById("wrong");
const questions = document.getElementById("questions");
const head = document.getElementById("title");
const showAnswer = document.getElementById("showAnswer");
const quiz = [
{
title: 'Add an external style sheet with the URL: "mystyle.css".',
question: `<p><head><br><input style="width:260px;" type="text" maxlength="42"><br></head><br><br><body>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: '<link rel="stylesheet" href="mystyle.css">',
},
{
title:
"Set the page's background color to red, by using an inline style.",
question: `<p><body <input type="text" maxlength="42">
="background-color: red"> <br><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "style",
},
{
title:
'Set the background color of the <h1> element to "lightblue".',
question: `<p><style><br>
h1 { <br>
<input style="width:250px;" type="text" maxlength="42">: lightblue;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "background-color",
},
{
title:
'Use the correct border property to set the LEFT border to "dotted".',
question: `<p><style><br>
p { <br>
<input style="width:250px;" type="text" maxlength="42">: dotted;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "border-left-style",
},
{
title: "Add a 20 pixels left margin to the <h1> element.",
question: `<p><style><br>
h1 { <br>
<input style="width:200px;" type="text" maxlength="42">: 20px;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "margin-left",
},
{
title: "Set the top padding of the <h1> element to 30 pixels.",
question: `<p><style><br>
h1 { <br>
<input style="width:200px;" type="text" maxlength="42">: 30px;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "padding-top",
},
{
title:
"Set the padding of all sides of the <h1> element to 30 pixels.",
question: `<p><style><br>
h1 { <br>
<input style="width:200px;" type="text" maxlength="42">: 30px;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "padding",
},
{
title: "Set the height of the <h1> element to 100px.",
question: `<p><style><br>
h1 { <br>
<input style="width:100px;" type="text" maxlength="42">: 100px;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "height",
},
{
title: "Set the width of the <h1> element to 50%.",
question: `<p><style><br>
h1 { <br>
<input style="width:100px;" type="text" maxlength="42">: 50%;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "width",
},
{
title: "Set the font-family for <h1> Verdana.",
question: `<p><style><br>
h1 { <br>
<input style="width:150px;" type="text" maxlength="42">: Verdana;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "font-family",
},
{
title: "Set the color of the <h1> element to blue.",
question: `<p><style><br>
h1 { <br>
<input style="width:100px;" type="text" maxlength="42">: blue;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "color",
},
{
title: "Set the font-size of the <h1> element to 20px.",
question: `<p><style><br>
h1 { <br>
<input style="width:100px;" type="text" maxlength="42">: 20px;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "font-size",
},
{
title: "Set the font-weight of the <h1> element to bold.",
question: `<p><style><br>
h1 { <br>
<input style="width:150px;" type="text" maxlength="42">: bold;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "font-weight",
},
{
title: "Set the text-align of the <h1> element to center.",
question: `<p><style><br>
h1 { <br>
<input style="width:100px;" type="text" maxlength="42">: center;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "text-align",
},
{
title:
"Set the text-decoration of the <h1> element to underline.",
question: `<p><style><br>
h1 { <br>
<input style="width:180px;" type="text" maxlength="42">: underline;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "text-decoration",
},
{
title:
"Set the text-transform of the <h1> element to uppercase.",
question: `<p><style><br>
h1 { <br>
<input style="width:150px;" type="text" maxlength="42">: uppercase;<br>
}<br>
</style><br>
<body><br>
<h1>This is a heading</h1><br>
<p>This is a paragraph</p><br>
<p>This is a paragraph</p><br>
</body></p>`,
answer: "text-transform",
},
];
</script>
<script src="../Scripts&xml/Exercise.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script>
</body>
</html>