CSS Class Selectors

The .class selector is used to select the elements with a specific class attribute.

Class Syntax

You declare a CSS class by using a dot (.) followed by the class name. You make up the class name yourself. After the class name you simply enter the properties/values that you want to assign to your class.

.class-name { property:value; }

Example of Code

   color: #0000ff;
<p class="blue">This is paragraph</p>


This is paragraph