Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS selector with two classes on one element

How do I do a CSS selector that selects a div that has the class of someButton AND current?

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

Please help me figure this out!

like image 472
Adam Avatar asked Sep 14 '26 23:09

Adam


2 Answers

You need to concatenate it: .someButton.current.

With a space, it will be seen as "apply on any element with class .current which is nested in a parent element with class .someButton".

like image 182
BalusC Avatar answered Sep 16 '26 22:09

BalusC


Remove the whitespace

.someButton.current
like image 24
Nick Spiers Avatar answered Sep 17 '26 00:09

Nick Spiers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!