CSS Class

How to create class in CSS : In the CSS an Class selector is a name always start with a dot character (“.”).
class can be used to identify more than one element

Example:

<!DOCTYPE html>
<html>
<head>
<style>
.test {
background-color:#FF0000;
}
</style>
</head>
<body>

<div class="test">

<p> Hello World </p>
<p> Welcome to CSS </p>

</div>

<p> My best friend is Vihaan. </p>

</body>
</html>

Leave a Reply

avatar
  Subscribe  
Notify of