index
<!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>
<p class="note">1. The element selector targets elements based on their HTML tag name.</p>
<ol>
<li class="note" value="2">Class selectors target elements based on the value of the class attribute.</li>
<li class="note" id="id-selector-demo" value="3">ID selectors target elements based on the value of the id
attribute.</li>
<li class="note" value="4">Attribute selectors target elements based on their attributes and values.</li>
<li class="note" value="5">The universal selector targets all elements.</li>
</ol>
</body>
</html>
CSS
ol {
margin-left: -40px;
margin-top: -20px;
list-style-position: inside;
}
p{
color:red;
}
.note {
font-size: 20px;
}
#id-selector-demo {
color: green;
}
li[value="4"]{
color: blue;
}
*{
text-align: center;
}