The HTML class is an attribute which is used to specify equal styles for all the elements with the same class name. An ‘class’ selector is a name preceded by a full stop (“.”).

Class Breakdown

Here is the breakdown of HTML Class

Class Example

Below example will demonstrate the basic architecture of HTML Class.

<!doctype html>  

        <title>Class Example</title>
            .top {
                background-color: #ccc;
                padding: 20px

        <div class="top">