Javatpoint Logo
Javatpoint Logo

CSS Class

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.

Syntax

Let's understand it using the following illustrations.

Example 1

Test it Now

Example 2

Test it Now

Next TopicCSS Center Image




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA