火狐悬停不透明度

发布于 2024-10-12 06:26:12 字数 363 浏览 6 评论 0原文

我无法在 Firefox 或 IE 中更改悬停不透明度。它在 Chrome 中工作。 Firefox 和 IE 能够使用 .move 中定义的不透明度初始状态,但不能在悬停时使用。任何想法。

<style>
.move{
  width:100px;
  height:100px;
  background-color:red;
  opacity:0.2;
  filter:alpha(opacity=20);
  }
.move:hover{
  opacity:1;
  filter:alpha(opacity=100);
  }
</style>

<div class="move"></div>

I can't get hover opacity to change in firefox or IE. it's working in chrome. Firefox and IE is able to work with opacity initial state as defined in .move, but just not on hover. Any ideas.

<style>
.move{
  width:100px;
  height:100px;
  background-color:red;
  opacity:0.2;
  filter:alpha(opacity=20);
  }
.move:hover{
  opacity:1;
  filter:alpha(opacity=100);
  }
</style>

<div class="move"></div>

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

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

发布评论

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

评论(2

她说她爱他 2024-10-19 06:26:12

这是一个错误: http://support.mozilla.com/pa-IN/questions/ 746770

快速修复正在替换:

.move:hover{

使用

[class="move"]:hover{

位于 http://www 中找到的脚本.xs4all.nl/~peterned/csshover.html 解决 IE 怪癖。

最终代码是

<style>
 body {
  behavior:url('csshover3.htc');
 }

.move{
  width:100px;
  height:100px;
  background-color:red;
  opacity:0.2;
  filter:alpha(opacity=20);
  -moz-opacity:0.2;
  -khtml-opacity: 0.2;
  }
.move:hover{
  opacity:1;
  filter:alpha(opacity=100);
  -moz-opacity:1.0;
  -khtml-opacity: 1.0;
  }
[class="move"]:hover{
  opacity:1;
  filter:alpha(opacity=100);
  -moz-opacity:1.0;
  -khtml-opacity: 1.0;
  }
</style>

<div class="move"></div>

您需要添加 -moz-opacity 和 -khtml-opacity 以支持 webkit 和较旧的 Firefox 安装。

This is a bug: http://support.mozilla.com/pa-IN/questions/746770

The quick fix is replacing:

.move:hover{

with

[class="move"]:hover{

Use the script found at http://www.xs4all.nl/~peterned/csshover.html to address IE quirks.

Final code is

<style>
 body {
  behavior:url('csshover3.htc');
 }

.move{
  width:100px;
  height:100px;
  background-color:red;
  opacity:0.2;
  filter:alpha(opacity=20);
  -moz-opacity:0.2;
  -khtml-opacity: 0.2;
  }
.move:hover{
  opacity:1;
  filter:alpha(opacity=100);
  -moz-opacity:1.0;
  -khtml-opacity: 1.0;
  }
[class="move"]:hover{
  opacity:1;
  filter:alpha(opacity=100);
  -moz-opacity:1.0;
  -khtml-opacity: 1.0;
  }
</style>

<div class="move"></div>

You need to add -moz-opacity and -khtml-opacity to support webkit and older firefox installations.

陈甜 2024-10-19 06:26:12

不透明度规则在 ie 中都被搞乱了。 ie7和6不支持它们。
我看不出它在 FF 上不起作用的任何原因。

opacity rule is all wacked in ie. ie7 and 6 doesnt support them.
i couldnt see any reason that y it didnt work on FF.

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