Categories
CSS

How to select elements with two classes with CSS?

Spread the love

To select elements with two classes with CSS, we add both class selectors.

For instance, we werite

.foo.bar {
  color: red;
}

to add select elements with both the foo and bar class applied and set their content color to red.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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