Applying CSS rules only if an element is specified for 2 classes

Possible duplicate:
Is it possible to target an element using CSS only if there are 2 classes?
CSS selector that applies to elements with two classes

Is there a way to apply CSS style to an element only if 2 classes are applied to it?

For example, apply my custom styles to this:

<div class="one two">Text</div> 

But not to these:

 <div class="one">Text</div> <div class="two">Text</div> 
+6
source share
2 answers

Of course:

 .one.two { border: 1px red solid } 
+14
source

Try using css .one.two in the selector

+2
source

Source: https://habr.com/ru/post/921680/


All Articles