Languages
[Edit]
EN

CSS - style only elements with multiple classes

3 points
Created by:
Palpys
764

In this article, we would like to show you how to style only those elements that have multiple classes using CSS.

Quick solution:

Where:

  • class-1, class-2, ... , class-N are class names assigned to the HTML element at once.

 

Practical example

Edit

In this example, we present how to style only those elements, that have assigned both class-1 and class-2 to them.

 

See also

Edit
  1. JavaScript - get handle to HTML element with multiple classes

Alternative titles

  1. CSS - style only those elements that have multiple classes
  2. CSS - style only elements with two or more classes
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join