The selector .class is used to select the elements that belong to the specific class attribute. For selecting an element using a particular class, we can use the (.) character, followed by the name of the corresponding class. The name of the class is widely used to set the CSS property to the specific class.
It is to make sure that a class name should not be started with a number.
Let's understand it using the following illustrations.
Example 1Test it Now
Example 2Test it Now