til

Use A CSS Class To Style An Element

<head>
    <style>
    .red-text {
        color: red;
    }
    </style>
</head>

<body>
    <h2 class="red-text">CatPhotoApp</h2>
</body>

Note that in your CSS style element, class names start with a period.

In your HTML elementsโ€™ class attribute, the class name does not include the period.

source