-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
2459 lines (2164 loc) · 94.9 KB
/
index.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
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Mastery: From Beginner to Advanced</title>
<!-- Link to the external CSS file -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Typewriter effect heading -->
<h1 id="typewriter"></h1>
<!-- Navbar with links (Initially hidden with opacity) -->
<nav id="navbar">
<ul>
<li><a href="#" id="beginnerLink">Beginner</a></li>
<li><a href="#" id="intermediateLink">Intermediate</a></li>
<li><a href="#" id="advancedLink">Advanced</a></li>
<li><a href="https://www.thugcoding.com" target="_blank">ThugCoding</a></li>
<li><a href="https://www.yourblog.com" target="_blank">Blog</a></li>
</ul>
</nav>
<!-- Beginner Text and Quiz Etc -->
<div id="beginnerText" class="section hidden"> Ready, Nigga? <h2>Beginner CSS</h2>
<p><h1>1. Introduction to CSS</h1></p> <p><strong>What is CSS?</strong>: Explain that CSS stands for "Cascading Style Sheets" and is used to control the layout and appearance of web pages.</p>
<p><strong>How CSS Works:</strong> Explain how CSS is used alongside HTML to style the content on a webpage.</p>
<h3>Ways to Include CSS:</h3>
<ul>
<li><strong>Inline CSS:</strong> Styling directly within an HTML element.</li>
<li><strong>Internal CSS:</strong> CSS within a <style> tag in the HTML document.</li>
<li><strong>External CSS:</strong> Linking to an external .css file.</li>
</ul>
<h2>2. Basic Syntax</h2>
<p><strong>CSS Rule Structure:</strong> Show how a CSS rule consists of a selector, property, and value.</p>
<pre>
selector {
property: value;
}
</pre>
<p><strong>Example:</strong></p>
<pre>
h1 {
color: blue;
}
</pre>
<p><strong>Selector:</strong> Targets the HTML element.</p>
<p><strong>Property:</strong> Defines the styling (e.g., color).</p>
<p><strong>Value:</strong> The value for the property (e.g., blue).</p>
<h2>3. Selectors</h2>
<h3>Basic Selectors:</h3>
<ul>
<li><strong>Element Selectors:</strong> Selects HTML tags (e.g., <h1>, <p>).</li>
<li><strong>Class Selectors:</strong> Targets elements with a specific class using the <strong>.</strong> (dot) notation (e.g., .myClass).</li>
<li><strong>ID Selectors:</strong> Targets elements by their id using <strong>#</strong> (hash) notation (e.g., #myId).</li>
</ul>
<h3>Combining Selectors:</h3>
<ul>
<li><strong>Grouping Selectors:</strong> Applying the same styles to multiple elements (e.g., h1, h2, h3).</li>
<li><strong>Descendant Selectors:</strong> Targeting an element inside another element (e.g., div p).</li>
</ul>
<h2>4. CSS Box Model</h2>
<p>Introduce the Box Model, which is fundamental to layout and spacing.</p>
<ul>
<li><strong>Content:</strong> The actual content inside the box.</li>
<li><strong>Padding:</strong> Space between the content and the border.</li>
<li><strong>Border:</strong> Surrounds the padding (or content if no padding).</li>
<li><strong>Margin:</strong> Space outside the border.</li>
</ul>
<p><strong>Example Diagram:</strong></p>
<pre>
+----------------------------+
| Margin |
| +------------------------+ |
| | Border | |
| | +--------------------+ | |
| | | Padding | | |
| | | +----------------+ | | |
| | | | Content | | | |
| | | +----------------+ | | |
| | +--------------------+ | |
| +------------------------+ |
+----------------------------+
</pre>
<h2>5. Colors and Backgrounds</h2>
<p><strong>Setting Colors:</strong> How to apply colors using different formats:</p>
<ul>
<li><strong>Named Colors</strong> (e.g., red, blue).</li>
<li><strong>Hexadecimal</strong> (#ff0000 for red).</li>
<li><strong>RGB</strong> (rgb(255, 0, 0) for red).</li>
<li><strong>HSL</strong> (hsl(0, 100%, 50%) for red).</li>
</ul>
<p><strong>Backgrounds:</strong></p>
<ul>
<li><strong>Background Color:</strong> background-color.</li>
<li><strong>Background Images:</strong> background-image.</li>
<li><strong>Background Positioning:</strong> background-position, background-size.</li>
</ul>
<h2>6. Typography</h2>
<h3>Font Properties:</h3>
<ul>
<li><strong>font-family:</strong> Set the font type (e.g., Arial, Courier New).</li>
<li><strong>font-size:</strong> Control the size of the text (e.g., 16px, 1.5em).</li>
<li><strong>font-weight:</strong> Control the thickness of the text (bold, normal, lighter).</li>
<li><strong>font-style:</strong> Set italic or normal text (italic, normal).</li>
</ul>
<h3>Text Styling:</h3>
<ul>
<li><strong>color:</strong> Set text color.</li>
<li><strong>text-align:</strong> Control text alignment (left, center, right).</li>
<li><strong>line-height:</strong> Adjust space between lines.</li>
<li><strong>text-decoration:</strong> Control underlining or strike-through (e.g., underline, none).</li>
</ul>
<h2>7. Margins, Padding, and Borders</h2>
<ul>
<li><strong>Margin:</strong> How to use margin to create space around elements.</li>
<li><strong>Padding:</strong> How to use padding to create space within elements.</li>
<li><strong>Borders:</strong> Adding borders to elements (border: 1px solid black).</li>
<li><strong>Shorthand Properties:</strong> Using shorthand for setting margins, padding, and borders.</li>
</ul>
<h2>8. Width, Height, and Display Properties</h2>
<h3>Setting Dimensions:</h3>
<ul>
<li><strong>width:</strong> Control the width of an element.</li>
<li><strong>height:</strong> Control the height of an element.</li>
</ul>
<h3>Display Property:</h3>
<ul>
<li><strong>block:</strong> Forces the element to take up the full width.</li>
<li><strong>inline:</strong> Keeps elements inline with others.</li>
<li><strong>inline-block:</strong> A combination of inline and block.</li>
<li><strong>none:</strong> Hides the element from the page.</li>
</ul>
<h2>9. Positioning Elements</h2>
<ul>
<li><strong>Static:</strong> Default positioning.</li>
<li><strong>Relative:</strong> Position relative to its normal position.</li>
<li><strong>Absolute:</strong> Position relative to the nearest positioned ancestor.</li>
<li><strong>Fixed:</strong> Positioned relative to the viewport (doesn’t scroll with the page).</li>
<li><strong>Z-index:</strong> Control the layering of elements on top of each other.</li>
</ul>
<h2>10. Introduction to Flexbox</h2>
<p>Give a basic introduction to Flexbox for beginners to layout content.</p>
<pre>
display: flex; /* Defines a flex container */
justify-content: flex-start; /* Aligns items horizontally */
align-items: center; /* Aligns items vertically */
flex-direction: row; /* Set the direction of the flex items */
</pre>
<h2>11. CSS Comments</h2>
<p><strong>How to write comments in CSS:</strong></p>
<pre>
/* This is a comment in CSS */
</pre>
</p>
<!--BEGINNER QUIZ-->
<div class="quiz-container">
<h2>Beginner CSS Quiz (47 Questions)</h2>
<!-- Question 1 -->
<div class="question">
<p>1. What does CSS stand for?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. Cascading Style Sheets</li>
<li>B. Computer Style Sheets</li>
<li>C. Colorful Style Sheets</li>
<li>D. Creative Style Sheets</li>
</ul>
</div>
<!-- Question 2 -->
<div class="question">
<p>2. Which HTML tag is used to define an internal style sheet?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. <style></li>
<li>B. <css></li>
<li>C. <script></li>
<li>D. <stylesheet></li>
</ul>
</div>
<!-- Question 3 -->
<div class="question">
<p>3. Which HTML attribute is used to define inline styles?</p>
<ul class="answers">
<li>A. class</li>
<li><span class="checkbox"></span> B. style</li>
<li>C. font</li>
<li>D. styles</li>
</ul>
</div>
<!-- Question 4 -->
<div class="question">
<p>4. Which is the correct CSS syntax?</p>
<ul class="answers">
<li>A. {body: color=black;}</li>
<li>B. body: {color=black;}</li>
<li><span class="checkbox"></span> C. body {color: black;}</li>
<li>D. {body: black;}</li>
</ul>
</div>
<!-- Question 5 -->
<div class="question">
<p>5. How do you add a background color in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. background-color: yellow;</li>
<li>B. bgcolor: yellow;</li>
<li>C. color: yellow;</li>
<li>D. background: yellow;</li>
</ul>
</div>
<!-- Question 6 -->
<div class="question">
<p>6. Which CSS property is used to change the text color of an element?</p>
<ul class="answers">
<li>A. font-color</li>
<li><span class="checkbox"></span> B. color</li>
<li>C. text-color</li>
<li>D. background-color</li>
</ul>
</div>
<!-- Question 7 -->
<div class="question">
<p>7. How do you make all <p> elements bold?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. p {font-weight: bold;}</li>
<li>B. p {font-style: bold;}</li>
<li>C. p {text-size: bold;}</li>
<li>D. p {font: bold;}</li>
</ul>
</div>
<!-- Question 8 -->
<div class="question">
<p>8. How do you center text in an element?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. text-align: center;</li>
<li>B. align-text: center;</li>
<li>C. text-align: middle;</li>
<li>D. align: center;</li>
</ul>
</div>
<!-- Question 9 -->
<div class="question">
<p>9. How do you add a comment in a CSS file?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. /* comment */</li>
<li>B. // comment</li>
<li>C. <!-- comment --></li>
<li>D. # comment</li>
</ul>
</div>
<!-- Question 10 -->
<div class="question">
<p>10. Which property is used to change the font of an element?</p>
<ul class="answers">
<li>A. font-weight</li>
<li><span class="checkbox"></span> B. font-family</li>
<li>C. font-style</li>
<li>D. text-style</li>
</ul>
</div>
<div class="question">
<p>11. How do you make the text uppercase in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. text-transform: uppercase;</li>
<li>B. text-style: uppercase;</li>
<li>C. transform-text: uppercase;</li>
<li>D. uppercase: text;</li>
</ul>
</div>
<!-- Question 12 -->
<div class="question">
<p>12. How do you change the margin of an element in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. margin: 10px;</li>
<li>B. padding: 10px;</li>
<li>C. spacing: 10px;</li>
<li>D. border-margin: 10px;</li>
</ul>
</div>
<!-- Question 13 -->
<div class="question">
<p>13. What is the default value of the position property in CSS?</p>
<ul class="answers">
<li>A. absolute</li>
<li>B. relative</li>
<li><span class="checkbox"></span> C. static</li>
<li>D. fixed</li>
</ul>
</div>
<!-- Question 14 -->
<div class="question">
<p>14. How do you remove underlining from links?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. a {text-decoration: none;}</li>
<li>B. a {decoration: no-underline;}</li>
<li>C. a {font-decoration: none;}</li>
<li>D. a {underline: none;}</li>
</ul>
</div>
<!-- Question 15 -->
<div class="question">
<p>15. How do you select an element with an id of "header"?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. #header</li>
<li>B. .header</li>
<li>C. header</li>
<li>D. *header</li>
</ul>
</div>
<!-- Question 16 -->
<div class="question">
<p>16. Which CSS property is used to change the spacing between lines of text?</p>
<ul class="answers">
<li>A. letter-spacing</li>
<li><span class="checkbox"></span> B. line-height</li>
<li>C. spacing</li>
<li>D. word-spacing</li>
</ul>
</div>
<!-- Question 17 -->
<div class="question">
<p>17. How do you make the background image repeat only horizontally?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. background-repeat: repeat-x;</li>
<li>B. background-repeat: repeat-y;</li>
<li>C. background-repeat: horizontally;</li>
<li>D. background-repeat: no-repeat;</li>
</ul>
</div>
<!-- Question 18 -->
<div class="question">
<p>18. Which property is used to specify the width of an element’s border?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. border-width</li>
<li>B. border-style</li>
<li>C. border-thickness</li>
<li>D. border-padding</li>
</ul>
</div>
<!-- Question 18 -->
<div class="question">
<p>19. How do you create space between the border and the content of an element??</p>
<ul class="answers">
<li><span class="checkbox"></span> A. padding</li>
<li>B. margin</li>
<li>C. border-spacing</li>
<li>D. line-spacing</li>
</ul>
</div>
<!-- Question 18 -->
<div class="question">
<p>20. How do you create a class selector in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. .classname</li>
<li>B. #classname</li>
<li>C. classname</li>
<li>D. *classname</li>
</ul>
</div>
<!-- Question 21 -->
<div class="question">
<p>21. How do you set the font size to 20px in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. font-size: 20px;</li>
<li>B. size: 20px;</li>
<li>C. text-size: 20px;</li>
<li>D. font-style: 20px;</li>
</ul>
</div>
<!-- Question 22 -->
<div class="question">
<p>22. How do you hide an element in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. display: none;</li>
<li>B. visibility: none;</li>
<li>C. hide: element;</li>
<li>D. display: hidden;</li>
</ul>
</div>
<!-- Question 23 -->
<div class="question">
<p>23. How do you specify a border with rounded corners in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. border-radius: 10px;</li>
<li>B. border-corner: 10px;</li>
<li>C. border-rounded: 10px;</li>
<li>D. border-style: rounded;</li>
</ul>
</div>
<!-- Question 24 -->
<div class="question">
<p>24. Which property is used to add a shadow behind text?</p>
<ul class="answers">
<li>A. box-shadow</li>
<li><span class="checkbox"></span> B. text-shadow</li>
<li>C. font-shadow</li>
<li>D. shadow-text</li>
</ul>
</div>
<!-- Question 25 -->
<div class="question">
<p>25. How do you apply a specific font family for a webpage?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. font-family: Arial, sans-serif;</li>
<li>B. font: Arial;</li>
<li>C. font-style: Arial;</li>
<li>D. text-family: Arial;</li>
</ul>
</div>
<!-- Question 26 -->
<div class="question">
<p>26. What is the correct way to apply multiple CSS classes to an element?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. <div class="class1 class2"></li>
<li>B. <div class="class1, class2"></li>
<li>C. <div class="class1; class2"></li>
<li>D. <div class="class1.class2"></li>
</ul>
</div>
<!-- Question 27 -->
<div class="question">
<p>27. How do you make a list of items appear horizontally in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. display: inline;</li>
<li>B. display: block;</li>
<li>C. display: inline-block;</li>
<li>D. display: list-inline;</li>
</ul>
</div>
<!-- Question 28 -->
<div class="question">
<p>28. How do you change the transparency of an element in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. opacity: 0.5;</li>
<li>B. transparent: 0.5;</li>
<li>C. visibility: 0.5;</li>
<li>D. transparency: 50%;</li>
</ul>
</div>
<!-- Question 29 -->
<div class="question">
<p>29. Which property is used to control the order of items in a flex container?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. order;</li>
<li>B. position;</li>
<li>C. align-order;</li>
<li>D. flex-order;</li>
</ul>
</div>
<!-- Question 30 -->
<div class="question">
<p>30. What is the purpose of the z-index property?</p>
<ul class="answers">
<li>A. To set the position of an element in a 3D space</li>
<li><span class="checkbox"></span> B. To determine the stack order of elements</li>
<li>C. To align elements along the z-axis</li>
<li>D. To scale elements</li>
</ul>
</div>
<!-- Question 31 -->
<div class="question">
<p>31. How do you make an image responsive in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. max-width: 100%;</li>
<li>B. width: auto;</li>
<li>C. img-responsive;</li>
<li>D. width: responsive;</li>
</ul>
</div>
<!-- Question 32 -->
<div class="question">
<p>32. Which value of the position property will make an element stay in the same place even when scrolling the page?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. fixed;</li>
<li>B. absolute;</li>
<li>C. relative;</li>
<li>D. static;</li>
</ul>
</div>
<!-- Question 33 -->
<div class="question">
<p>33. Which property is used to define the space between the border and the element’s content?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. padding;</li>
<li>B. margin;</li>
<li>C. border-spacing;</li>
<li>D. line-spacing;</li>
</ul>
</div>
<!-- Question 34 -->
<div class="question">
<p>34. How do you make text italic in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. font-style: italic;</li>
<li>B. font-weight: italic;</li>
<li>C. text-style: italic;</li>
<li>D. style: italic;</li>
</ul>
</div>
<!-- Question 35 -->
<div class="question">
<p>35. What does vw stand for in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. Viewport width</li>
<li>B. Virtual width</li>
<li>C. Vertical width</li>
<li>D. Visible width</li>
</ul>
</div>
<!-- Question 36 -->
<div class="question">
<p>36. Which CSS property is used to change the appearance of a list marker?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. list-style-type;</li>
<li>B. list-type;</li>
<li>C. marker-style;</li>
<li>D. list-decoration;</li>
</ul>
</div>
<!-- Question 37 -->
<div class="question">
<p>37. How do you float an element to the left in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. float: left;</li>
<li>B. float: none;</li>
<li>C. position: left;</li>
<li>D. align: left;</li>
</ul>
</div>
<!-- Question 38 -->
<div class="question">
<p>38. How do you prevent an element from being clickable?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. pointer-events: none;</li>
<li>B. click: false;</li>
<li>C. disable-click: true;</li>
<li>D. display: no-click;</li>
</ul>
</div>
<!-- Question 39 -->
<div class="question">
<p>39. How do you make text align to the right in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. text-align: right;</li>
<li>B. align-right: text;</li>
<li>C. align: right;</li>
<li>D. justify: right;</li>
</ul>
</div>
<!-- Question 40 -->
<div class="question">
<p>40. Which property allows you to specify the spacing between letters?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. letter-spacing;</li>
<li>B. word-spacing;</li>
<li>C. text-spacing;</li>
<li>D. line-spacing;</li>
</ul>
</div>
<!-- Question 41 -->
<div class="question">
<p>41. How do you make a border dashed?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. border-style: dashed;</li>
<li>B. border-type: dashed;</li>
<li>C. border-decoration: dashed;</li>
<li>D. border-line: dashed;</li>
</ul>
</div>
<!-- Question 42 -->
<div class="question">
<p>42. How do you center a block element horizontally?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. margin: 0 auto;</li>
<li>B. padding: center;</li>
<li>C. align: center;</li>
<li>D. text-align: center;</li>
</ul>
</div>
<!-- Question 43 -->
<div class="question">
<p>43. How do you make an element invisible but still occupy space?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. visibility: hidden;</li>
<li>B. display: none;</li>
<li>C. opacity: 0;</li>
<li>D. visibility: none;</li>
</ul>
</div>
<!-- Question 44 -->
<div class="question">
<p>44. What does rem stand for in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. Root em</li>
<li>B. Real em</li>
<li>C. Relative em</li>
<li>D. Reference em</li>
</ul>
</div>
<!-- Question 45 -->
<div class="question">
<p>45. How do you select an element by attribute in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. [attribute]</li>
<li>B. #attribute</li>
<li>C. .attribute</li>
<li>D. *attribute</li>
</ul>
</div>
<!-- Question 46 -->
<div class="question">
<p>46. How do you apply bold text in CSS?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. font-weight: bold;</li>
<li>B. font: bold;</li>
<li>C. font-style: bold;</li>
<li>D. text-weight: bold;</li>
</ul>
</div>
<!-- Question 47 -->
<div class="question">
<p>47. What is the default value of the display property?</p>
<ul class="answers">
<li>A. block</li>
<li>B. inline</li>
<li>C. inline-block</li>
<li><span class="checkbox"></span> D. inline or block (depending on the element)</li>
</ul>
</div>
<p></p>
</div>
<!--quiz div--> </div>
</div>
<!-- Intermediate Text and Quiz Etc -->
<div id="intermediateText" class="section hidden">Alright, My Nigga. Section 2 <h1>Intermediate CSS</h1>
<h2>1. CSS Specificity</h2>
<p>CSS specificity determines which CSS rule is applied by the browser when multiple rules target the same element. Specificity is calculated based on the types of selectors used.</p>
<ul>
<li><strong>Inline Styles:</strong> Highest specificity.</li>
<li><strong>ID Selectors:</strong> Higher specificity than class and element selectors.</li>
<li><strong>Class Selectors:</strong> Moderate specificity.</li>
<li><strong>Element Selectors:</strong> Lower specificity.</li>
</ul>
<p><strong>Example:</strong></p>
<pre>
#myId {
color: red;
}
.myClass {
color: blue;
}
p {
color: green;
}
</pre>
<p>If a paragraph element (<p>) has both a class and an ID applied to it, the ID selector will take precedence.</p>
<h2>2. The Cascade and Inheritance</h2>
<p>The cascade is how CSS applies rules according to importance (source order) and specificity. Some properties are inherited from parent elements, and others are not.</p>
<ul>
<li><strong>Cascade:</strong> Determines which rule wins when rules conflict.</li>
<li><strong>Inheritance:</strong> Certain properties, such as color and font-family, are inherited by child elements, while others like padding and margin are not.</li>
</ul>
<h2>3. Pseudo-classes and Pseudo-elements</h2>
<p>Pseudo-classes and pseudo-elements allow you to style elements based on their state or add styles to parts of an element.</p>
<ul>
<li><strong>Pseudo-classes:</strong> Target elements in a specific state (e.g., :hover, :focus, :nth-child).</li>
<li><strong>Pseudo-elements:</strong> Style specific parts of elements (e.g., ::before, ::after, ::first-line).</li>
</ul>
<p><strong>Example of pseudo-class:</strong></p>
<pre>
a:hover {
color: red;
}
</pre>
<p><strong>Example of pseudo-element:</strong></p>
<pre>
p::first-line {
font-weight: bold;
}
</pre>
<h2>4. CSS Positioning</h2>
<p>Understanding CSS positioning is essential for controlling the layout of elements.</p>
<ul>
<li><strong>Relative Positioning:</strong> Moves an element relative to its original position.</li>
<li><strong>Absolute Positioning:</strong> Moves an element in relation to the nearest positioned ancestor (not static).</li>
<li><strong>Fixed Positioning:</strong> Fixes an element relative to the viewport (it stays in place while scrolling).</li>
<li><strong>Sticky Positioning:</strong> Toggles between relative and fixed positioning, depending on the scroll position.</li>
</ul>
<p><strong>Example:</strong></p>
<pre>
div {
position: absolute;
top: 50px;
left: 100px;
}
</pre>
<h2>5. CSS Transitions</h2>
<p>CSS transitions allow you to change property values smoothly over a specified duration.</p>
<p><strong>Basic Syntax:</strong></p>
<pre>
element {
transition: property duration timing-function delay;
}
</pre>
<p><strong>Example:</strong></p>
<pre>
button {
background-color: blue;
transition: background-color 0.5s ease;
}
button:hover {
background-color: green;
}
</pre>
<h2>6. CSS Animations</h2>
<p>CSS animations allow you to create more complex animations than transitions by defining keyframes.</p>
<p><strong>Basic Syntax:</strong></p>
<pre>
@keyframes myAnimation {
0% {
opacity: 0;
transform: translateY(-50px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
element {
animation: myAnimation 2s ease-in-out infinite;
}
</pre>
<h2>7. CSS Flexbox</h2>
<p>The Flexbox layout is designed to help you distribute space and align items within a container.</p>
<ul>
<li><strong>Flex Container:</strong> The parent element with <code>display: flex;</code>.</li>
<li><strong>Flex Items:</strong> The children of the flex container.</li>
</ul>
<p><strong>Flex Properties for the Container:</strong></p>
<ul>
<li><strong>flex-direction:</strong> Defines the direction of the flex items (row, column).</li>
<li><strong>justify-content:</strong> Aligns items horizontally (start, center, space-between).</li>
<li><strong>align-items:</strong> Aligns items vertically (stretch, center, flex-start).</li>
</ul>
<p><strong>Example:</strong></p>
<pre>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</pre>
<h2>8. CSS Grid</h2>
<p>CSS Grid is a layout system designed for two-dimensional layouts, allowing you to position elements into rows and columns.</p>
<p><strong>Basic Syntax:</strong></p>
<pre>
.container {
display: grid;
grid-template-columns: 1fr 2fr 1fr;
grid-template-rows: auto;
grid-gap: 10px;
}
</pre>
<p><strong>Grid Properties:</strong></p>
<ul>
<li><strong>grid-template-columns:</strong> Defines the number and size of columns.</li>
<li><strong>grid-template-rows:</strong> Defines the number and size of rows.</li>
<li><strong>grid-gap:</strong> Adds space between the grid items.</li>
</ul>
<h2>9. Media Queries</h2>
<p>Media queries allow you to apply different styles depending on the device's screen size or capabilities.</p>
<p><strong>Basic Syntax:</strong></p>
<pre>
@media (max-width: 600px) {
body {
background-color: lightblue;
}
}
</pre>
<h2>10. Responsive Design</h2>
<p>Responsive design ensures your website works well on different devices and screen sizes by using flexible layouts, media queries, and other techniques.</p>
<ul>
<li><strong>Fluid Layouts:</strong> Use relative units like percentages for widths.</li>
<li><strong>Media Queries:</strong> Apply different styles based on device size or other features.</li>
<li><strong>Flexible Images:</strong> Ensure images scale properly within their containers.</li>
</ul>
<!--BEGINNER QUIZ-->
<div class="quiz-container">
<h2>Intermediate CSS Quiz (60 Questions)</h2>
<!-- Question 1 -->
<!-- Question 1 -->
<div class="question">
<p>1. What does the display: flex; property do in CSS?</p>
<ul class="answers">
<li>A. Makes an element a grid container</li>
<li>B. Makes an element a block-level element</li>
<li><span class="checkbox"></span> C. Makes an element a flex container</li>
<li>D. Makes an element an inline-level element</li>
</ul>
</div>
<!-- Question 2 -->
<div class="question">
<p>2. How do you align items to the center vertically in a flex container?</p>
<ul class="answers">
<li>A. justify-content: center;</li>
<li><span class="checkbox"></span> B. align-items: center;</li>
<li>C. align-self: center;</li>
<li>D. vertical-align: middle;</li>
</ul>
</div>
<!-- Question 3 -->
<div class="question">
<p>3. Which property is used to specify the direction of items in a flex container?</p>
<ul class="answers">
<li>A. align-items</li>
<li>B. flex-wrap</li>
<li><span class="checkbox"></span> C. flex-direction</li>
<li>D. justify-content</li>
</ul>
</div>
<!-- Question 4 -->
<div class="question">
<p>4. What is the default value of flex-direction?</p>
<ul class="answers">
<li>A. column</li>
<li><span class="checkbox"></span> B. row</li>
<li>C. row-reverse</li>
<li>D. column-reverse</li>
</ul>
</div>
<!-- Question 5 -->
<div class="question">
<p>5. Which property is used to allow items to wrap onto multiple lines in a flex container?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. flex-wrap</li>
<li>B. wrap-items</li>
<li>C. wrap-direction</li>
<li>D. multi-line</li>
</ul>
</div>
<!-- Question 6 -->
<div class="question">
<p>6. How do you define a grid container in CSS?</p>
<ul class="answers">
<li>A. display: block;</li>
<li>B. display: flex;</li>
<li><span class="checkbox"></span> C. display: grid;</li>
<li>D. display: inline-grid;</li>
</ul>
</div>
<!-- Question 7 -->
<div class="question">
<p>7. Which property defines the number and size of columns in a grid layout?</p>
<ul class="answers">
<li>A. grid-template-rows</li>
<li>B. grid-column-start</li>
<li>C. grid-auto-columns</li>
<li><span class="checkbox"></span> D. grid-template-columns</li>
</ul>
</div>
<!-- Question 8 -->
<div class="question">
<p>8. How do you set a gap between grid items in a grid container?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. grid-gap</li>
<li>B. grid-spacing</li>
<li>C. gap-size</li>
<li>D. spacing-grid</li>
</ul>
</div>
<!-- Question 9 -->
<div class="question">
<p>9. How do you span an item across multiple columns in a grid layout?</p>
<ul class="answers">
<li><span class="checkbox"></span> A. grid-column: span 2;</li>
<li>B. grid-column: 2;</li>
<li>C. grid-row: span 2;</li>
<li>D. grid-column-start: 2;</li>
</ul>
</div>
<!-- Question 10 -->
<div class="question">
<p>10. Which property is used to control the alignment of grid items along the row axis?</p>
<ul class="answers">
<li>A. align-items</li>
<li>B. align-content</li>
<li><span class="checkbox"></span> C. justify-content</li>
<li>D. grid-align</li>