-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcss selectors.html
36 lines (26 loc) · 1.26 KB
/
css selectors.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
### CSS SELECTORS WITH HTML TAGS ###
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Selectors</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<h1>CSS Selectors</h1>
<h2>Applying CSS to Different Parts of HTML</h2>
<!-- TODO 1: Set the CSS for all paragraph tags to "color: red" -->
<p class="note">1. The element selector targets elements based on their HTML tag name.</p>
<ol>
<!-- TODO 2: Set the CSS for all elements with a class of "note" to "font-size: 20px" -->
<li class="note" value="2">Class selectors target elements based on the value of the class attribute.</li>
<!-- TODO 3: Set the CSS for the element with an id of "id-selector-demo" to "color: green" -->
<li class="note" id="id-selector-demo" value="3">ID selectors target elements based on the value of the id
attribute.</li>
<!-- TODO 4: Set the CSS for the li elements that have the "value" attribute set to "4" to have "color: blue" -->
<li class="note" value="4">Attribute selectors target elements based on their attributes and values.</li>
<!-- TODO 5: Set all elements to have "text-align: center" -->
<li class="note" value="5">The universal selector targets all elements.</li>
</ol>
</body>
</html>