Let's see the Css selectors
It consist of the three selectors
Element selector
Id selector
Class selector
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Css selectors</title>
<style>
/* This is element selector */
h2{color: peru;}
/* This is id selector */
#firstpara{color:yellowgreen}
/* This is class selector */
.redcolor{
background-color: orangered;
}
/* This is class selector */
.bgblue{background-color: purple;}
/* This is combined selector */
footer,span{background-color: coral;color: black;}
</style>
</head>
<body>
<!-- we use here internal css -->
<h2>Css selectors</h2>
<p id="firstpara" class="redcolor">This is the time to learn the more and more about the css</p>
<p id="redel" class="redcolor bgblue"> This is the time to learn the more and more about the css</p>
<div>
<p >This is the time to learn the more and more about the css</p>
<span>It is the Inline element</span>
</div>
<footer>It is nicely completed </footer>
</body>
</html>
Tags:
Css selectors