welcome to tutorialfamily

css-selector

css selector used for applying property to element.

Property applying through id, class, and * selector


css selector – css selector used for applying styling to element of web pages.

here we show you three way to apply styling through selector. id, class, *.


id selector


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
#car{
   color: red;
   font-size: 40px;
}
</style>
</head>
<body>
   <div id="car">my car</div>
</body>
</html>


class selector


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
.car{
   color: red;
   font-size: 40px;
}
</style>
</head>
<body>
   <div class="car">my car</div>
</body>
</html>


all selector


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
*{
   color: red;
   font-size: 40px;
}
</style>
</head>
<body>
   <p>my car</p>
   <h1>my car</h1>
   <div>my car</div>
</body>
</html>


Our Content