How work and use classes in css?

I do not understand, How classes work (video no 22)? Why we use, where we use and how we use classes? Tell me?

Hi @vishalvats18071997,
Classes are used to apply a common style to multiple elements, as per the requirements.

For example,

    color: brown;
<h1 class="coffee">Coffee</h1>
<p>Order an <span class="coffee">coffee</span> here.</p>

In the above example, whichever element has the class of coffee, will render the text in brown color.

Do let me know if you need any other help.

1 Like