More
CSS selectors is used to select HTML elements which you want to syle.
Syntax –
Id=” unique id name here ”
For example
<html>
<head>
<title>Teknowize</title>
<link rel="stylesheet" type="text/css" href="G:/style.css">
<style>
#kuchv {
Color: red;
}
</style>
</head>
<body>
<h2> welcome to teknowize</h2>
<h2 id="kuchv"> thank you </h2>
<p> this is my website </p>
</body>
</html>
Output
Syntax –
class=" unique class name here "
For example
<html>
<head>
<title>Teknowize</title>
<link rel="stylesheet" type="text/css" href="G:/style.css">
<style>
.kuchv1 {
Color: red;
}
.kuchv2 {
font-size: 1rem;
}
</style>
</head>
<body>
<h2> welcome to teknowize</h2>
<h2 class="kuchv1 kuchv2 "> thank you </h2>
<p> this is my website </p>
</body>
</html>
Output
For example
<html>
<head>
<title>Teknowize</title>
<link rel="stylesheet" type="text/css" href="G:/style.css">
<style>
* {
Color: red;
}
</style>
</head>
<body>
<h2> welcome to teknowize</h2>
<h2> thank you </h2>
<p> this is my website </p>
</body>
</html>
Output
For example
<html>
<head>
<title>Teknowize</title>
<link rel="stylesheet" type="text/css" href="G:/style.css">
<style>
p {
Color: red;
}
</style>
</head>
<body>
<h2> welcome to teknowize</h2>
<h2> thank you </h2>
<p> this is my website </p>
</body>
</html>
Output