CSS selector with two classes on one element

How to make a CSS selector that selects a div that has an someButtonAND class current?

.someButton .current { /* select current with the parent div of .someButton, correct? */

Please help me figure this out!

+3
source share
3 answers

You need to combine it: .someButton.current.

With a space, it will be considered as "apply to any element with a class .currentthat is nested in the parent element with the class .someButton."

+8
source

Remove spaces

.someButton.current
+2
source

div.someButton.current {...}

0
source

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


All Articles