What is CSS class selector?

A CSS class is used to group similar HTML elements. This helps us to apply same style to those elements by placing them in the same class.

Class methods can be called by inserting a ‘class’ property and name within an HTML element

<p class="green"> Sample Text </p>
<p class="green"> Sample Text </p>
<p class="green"> Sample Text </p>

Then, we can call class name with a '.' in the CSS file. For example:
.green { color: green; }


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.