Adam
Adam

Reputation: 9459

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!

Upvotes: 3

Views: 324

Answers (3)

AdamZ
AdamZ

Reputation: 1

div.someButton.current { ... }

Upvotes: 0

BalusC
BalusC

Reputation: 1109875

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".

Upvotes: 8

Nick Spiers
Nick Spiers

Reputation: 2354

Remove the whitespace

.someButton.current

Upvotes: 2

Related Questions