问题
I am styling a div that uses jQuery to add a .active
class to the div when selected. The background of the div is a gradient, which I would like to keep. I am using the filter:
property to display the gradient in IE. The active class modifies the background to a solid color, but in IE, the filter:
CSS property overrides the .active
styling.
Is there a solution to this, so the .active
class will display the correct background color in IE?
See this example: http://jsbin.com/eDEjuzu/1/
Thanks
回答1:
Just add filter: none
to the .active
class. For IE6-9 gradients made with the filter
property override normal background
values, so you need to cancel out the gradient filter on hover
in addition to changing the background color.
Updated JSBin
来源:https://stackoverflow.com/questions/19168510/ie-gradient-filter-background-overriding-active-background-color