开发者

jQuery Droppable Hover and Active Class take Precedence?

开发者 https://www.devze.com 2022-12-18 03:14 出处:网络
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.

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 eleme开发者_Go百科nt.

How can I fix this behavior?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消