CSS 不透明度 - 互联网浏览器

发布于 2024-12-06 09:56:44 字数 345 浏览 3 评论 0原文

我今天正在处理不透明度,由于某种原因它无法在 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>

HOVER div 不起作用。 这里有什么问题吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖凝香 2024-12-13 09:56:44

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

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

此外,如果您使用 IE6,则 :hover 选择器将不适用于除 之外的任何内容; 标签。要解决这个问题,您需要使用类似 Whatever:hover 的东西。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文