Opera 中的 CSS 背景过渡经过黑色

发布于 2024-12-28 05:54:24 字数 359 浏览 5 评论 0原文

我刚刚开始学习 CSS3 转换(差不多是时候了!),我在 Opera 11.60 中看到了一些奇怪的行为。

我使用转换将元素从 background:none 更改为 background:#fff。然而,在达到目标之前,过渡实际上会经历黑色/深灰色。

现在,我可以理解为什么会发生这种情况 - 不透明度和颜色同时进行动画处理,并且由于颜色曾经是 none,Opera 将其视为 #000 。对我来说看起来像一个错误。

除了在 Opera 中关闭带有 background:none 的元素的过渡之外,有没有办法解决这个问题?

I'm just getting into CSS3 transitions (about time!) and I witness some strange behavior in Opera 11.60.

I use a transition to change an element from background:none to background:#fff. However, the transition actually goes through black/dark grey before reaching its target.

Now, I can understand why this happens - the opacity and the color are animated at the same time, and since the color used to be none, Opera regards it as #000. Looks like a bug to me.

Is there a way to fix this, save for turning off transitions in Opera for elements with background:none?

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

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

发布评论

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

评论(1

无敌元气妹 2025-01-04 05:54:24

尝试从 background: rgba(255,255,255,0) 转换到 background: rgba(255,255,255,1) 怎么样? (这是从零不透明度的白色到完全不透明度的白色。)

参见例如 http://jsfiddle.net/tajMG/

How about trying a transition from background: rgba(255,255,255,0) to background: rgba(255,255,255,1)? (That’s from white with zero opacity to white with full opacity.)

See e.g. http://jsfiddle.net/tajMG/

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