如何设置IE的不透明度?鼠标悬停的问题
当我尝试在 css 中设置不透明度时,鼠标悬停事件不会被触发。我的CSS代码是-
.dropmenudiv_a{
position:absolute;
top: 0;
border: 1px solid white; /*THEME CHANGE HERE*/
border-top-width: 8px; /*Top border width. Should match height of .ddcolortabsline above*/
border-bottom-width: 0;
border-left-width: 0;
border-right-width: 0;
font:normal 12px Arial;
line-height:18px;
z-index:100;
background-color: lightgray;
width: 200px;
visibility: hidden;
opacity:0.9;
filter: alpha(opacity = 50); // for IE
}
.dropmenudiv_a a:hover{ /*THEME CHANGE HERE*/
background:url(media/menuover.jpg) repeat-x top;
color: white;
}
鼠标悬停时的背景图像在MOZILA中发生变化,但在IE中没有变化?当我删除过滤器:alpha(opacity = 50);时,它在IE中也工作正常,但不透明度在IE中不会出现。 ....????
When I am trying to set opacity in css, mouse over event is not getting fired. my css code is-
.dropmenudiv_a{
position:absolute;
top: 0;
border: 1px solid white; /*THEME CHANGE HERE*/
border-top-width: 8px; /*Top border width. Should match height of .ddcolortabsline above*/
border-bottom-width: 0;
border-left-width: 0;
border-right-width: 0;
font:normal 12px Arial;
line-height:18px;
z-index:100;
background-color: lightgray;
width: 200px;
visibility: hidden;
opacity:0.9;
filter: alpha(opacity = 50); // for IE
}
.dropmenudiv_a a:hover{ /*THEME CHANGE HERE*/
background:url(media/menuover.jpg) repeat-x top;
color: white;
}
background image on mouse over is getting changed in MOZILA but not in IE?When I remove filter: alpha(opacity = 50);, it is workin fine in IE also but then opacity is not coming in IE......????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 IE,您必须删除/重置过滤器样式,如下所示:
在 IE8 (Windows 7) 中尝试成功。
For IE you have to remove/reset the filter style, like this:
Tried it in IE8 (Windows 7) with success.
您可能看到的是 IE 错误,其中应用了
filter
的容器内的链接变得无法点击且无法聚焦。有时有效的修复方法是向链接添加 z-index:
What you're probably seeing is the IE bug where links within a container that has a
filter
applied become unclickable and unfocusable.A fix that sometimes works is to add a z-index to your links: