WillingLearner
WillingLearner

Reputation: 7316

Proper CSS syntax multiple classes

This works fine:

ul.tabs a.current:hover {
    background-position: -420px -31px;  
    color:#000; 
}   

but this dosent

ul.tabs a.commentArea.current:hover {
     background-position: -420px -31px; 
     color:#000; 
    }

Im getting the indication that I wrote this style incorrectly, as the css isnt working on my element. How would I write this correctly...proper syntax?

Upvotes: 0

Views: 822

Answers (3)

Julien
Julien

Reputation: 5779

ul.tabs a.commentArea:hover

Remove the space before :hover

See http://www.w3schools.com/CSS/css_pseudo_classes.asp

Upvotes: 0

sethvargo
sethvargo

Reputation: 26997

no space before :hover

ul.tabs a.commentArea:hover

Upvotes: 0

Pekka
Pekka

Reputation: 449813

It has to be

a.commentArea:hover

selectors targeting the same element must not be separated by spaces.

Upvotes: 1

Related Questions