css opacity - internet explorer

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 05:45:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!