html - CSS 不透明度 - Internet Explorer

标签 html css internet-explorer opacity

我今天正在使用不透明度,但由于某些原因它无法在 Internet Explorer 上运行

这是我的 CSS:

.box_1{opacity:0.4;filter:alpha(opacity=40)};
.box_1:hover{opacity:1.0;filter:alpha(opacity=100);}

这是我的 HTML:

<div class="box_1">
    <img src="abc.png"/>
</div>

悬停 div 不起作用。 这里有什么问题?

最佳答案

您在第一行末尾缺少一个大括号,它应该是:

.box_1{opacity:0.4;filter:alpha(opacity=40);}
.box_1:hover{opacity:1.0;filter:alpha(opacity=100);}

此外,如果您使用的是 IE6 :hover除了 <a> 之外,选择器将不起作用标签。要绕过它,你需要使用类似 Whatever:hover 的东西。 .

关于html - CSS 不透明度 - Internet Explorer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7546555/

相关文章:

javascript - 我可以在 ng-bind 中创建 JavaScript 对象吗?

html - 使单独容器中的两个 div 始终对齐

html - 文本 : decoration is not working for my link

jquery - JPlayer 控件在 IE 中困惑 - 在所有其他浏览器中工作正常

javascript - Ckeditor 中的虚拟(重复)节点 [IE]

javascript - jQuery 多版本在 IE 中无冲突

html - 更改输入组件输入区域线条颜色的默认颜色

html - 为什么在图像和某些文本之间添加边距或填充时我不能满意?

android - 地址栏隐藏 iOS/Android/Mobile Chrome 时背景图片跳转

java - 在vaadin中替换formlayout的单元格