How to apply two CSS classes to a single element?

Spread the love

Sometimes, we want to apply two CSS classes to a single element.

In this article, we’ll look at how to apply two CSS classes to a single element.

How to apply two CSS classes to a single element?

To apply two CSS classes to a single element, we separate the class names with spaces.

For instance, we write

<a class="c1 c2">aa</a>

to add the c1 and c2 classes to the a element.

Conclusion

To apply two CSS classes to a single element, we separate the class names with spaces.

Leave a Reply

Your email address will not be published. Required fields are marked *