views:

147

answers:

1

I'm having an issue where I see my active and hover class being applied in Firebug, but it's not taking precedence over the existing styles.

So, if my element has background-color set, the active and hover background color don't change the element.

How can I fix this behavior?

+2  A: 

Do you apply the original background-color with a class rule ? or an id rule ?

.something{background-color:...}

or

#something{background-color:...}

i am asking this because id rules have precedence over class rules

see http://www.w3.org/TR/CSS2/cascade.html#preshint for selector specificity details (as it is called). Id is only overridden by inline styles..

Gaby
Thanks, led me in the right direction. The active and hovered class was being applied at a lower level than the class that specified the static background color.
Colin