forked from Qasim-Rokeeb/HTML
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSS selectors.html
More file actions
44 lines (30 loc) · 1.11 KB
/
CSS selectors.html
File metadata and controls
44 lines (30 loc) · 1.11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS selectors</title>
<link rel="stylesheet" href="style3.css">
</head>
<body>
<h1>CSS Selectors</h1>
<p>CSS selectors are used to "find" (or select) the HTML elements you want to style.</p>
<h2>Types of Selectors</h2>
<ul>
<li>Universal Selector (*)</li>
<li>Type Selector (element)</li>
<li>Class Selector (.class)</li>
<li>ID Selector (#id)</li>
<li>Attribute Selector ([attribute])</li>
</ul>
<!-- example of Universal Selector: -->
<p>This paragraph will be styled by the universal selector.</p>
<!-- example of Type Selector: -->
<h2>This heading will be styled by the type selector.</h2>
<!-- example of ID Selector: -->
<p id="unique">This paragraph is styled using an ID selector.</p>
<!-- example of Class Selector: -->
<p class="car" >This paragraph is highlighted using a class selector.</p>
<!-- inline > ID > Class > Type > Universal -->
</body>
</html>