问题
i'm working with opacity today and from some reason it wont work on internet explorer
here is my CSS :
.box_1{opacity:0.4;filter:alpha(opacity=40)};
.box_1:hover{opacity:1.0;filter:alpha(opacity=100);}
and here is my HTML:
<div class="box_1">
<img src="abc.png"/>
</div>
the HOVER div does not work. what is the problem here?
回答1:
You're missing a curly bracket at the end of your first line, it should be:
.box_1{opacity:0.4;filter:alpha(opacity=40);}
.box_1:hover{opacity:1.0;filter:alpha(opacity=100);}
Also if you're using IE6 the :hover
selector won't work on anything except <a>
tags. To get around it you'll need to use something like Whatever:hover.
来源:https://stackoverflow.com/questions/7546555/css-opacity-internet-explorer