Opera 中的 CSS 背景过渡经过黑色
我刚刚开始学习 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试从
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)
tobackground: rgba(255,255,255,1)
? (That’s from white with zero opacity to white with full opacity.)See e.g. http://jsfiddle.net/tajMG/