2

I have the following css selector that is not working:

.button.button-green:hover

however if I do this, it works fine:

.button-green:hover

Is this a known issue with CSS and are there any ways around this (besided just using one class for the hover)?

4

1 回答 1

0

有关几个不同的选项,请参阅以下 jsbin:http: //jsbin.com/akowix/1/

你的 html 是什么样的?

  • 你有一个同时具有“button”类和“button-green”类的元素吗?
  • 或者你有一个“button”类的元素,其中包含一个“button-green”类的元素?
  • 或者您是否有两个不同的元素,一个带有“按钮”类,一个带有“按钮-绿色”类,您希望将悬停规则应用于两者?
于 2012-11-09T16:23:37.760 回答