How to Add Multiple Classes to an HTML Element?

Find out how to add multiple classes to an HTML element

You can add multiple classes to an HTML element by separating each one by a space in the element's class attribute, for example, like so:

<span class="one two three">
    foo bar
</span>

To select the HTML element in CSS using multiple class names, you can do the following:

.one.two.three { /* ... */ }
.one.two { /* ... */ }
/* ... */

Hope you found this post useful. It was published . Please show your love and support by sharing this post.