-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter12.html
More file actions
85 lines (76 loc) · 1.89 KB
/
chapter12.html
File metadata and controls
85 lines (76 loc) · 1.89 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chapter 12: CSS Syntax & Selectors</title>
<link rel="stylesheet" href="style.css">
<style>
/* Element selector */
p {
color: darkblue;
}
/* ID selector */
#special {
color: crimson;
font-weight: bold;
}
/* Class selector */
.highlight {
background-color: yellow;
}
/* Group selector */
h4, h5 {
color: green;
}
/* Universal selector */
* {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<h2 class="chapter-header">Chapter 12: CSS Syntax & Selectors</h2>
<div class="tag-section">
<h3>Element Selector</h3>
<div class="tag-demo">
<div class="head-demo">
<p>This paragraph is styled using an element selector (p).</p>
</div>
</div>
</div>
<div class="tag-section">
<h3>ID Selector</h3>
<div class="tag-demo">
<div class="head-demo">
<p id="special">This text is styled using an ID selector (#special).</p>
</div>
</div>
</div>
<div class="tag-section">
<h3>Class Selector</h3>
<div class="tag-demo">
<div class="head-demo">
<p class="highlight">This text is styled using a Class selector (.highlight).</p>
</div>
</div>
</div>
<div class="tag-section">
<h3>Group Selector</h3>
<div class="tag-demo">
<div class="head-demo">
<h4>This is an H4 heading styled by group selector.</h4>
<h5>This is an H5 heading styled by group selector.</h5>
</div>
</div>
</div>
<div class="tag-section">
<h3>Universal Selector</h3>
<div class="tag-demo">
<div class="head-demo">
<p>All text on this page uses Arial font due to universal selector (*).</p>
</div>
</div>
</div>
</body>
</html>