css background transition in opera goes through black

无人久伴 提交于 2020-01-04 05:35:35

问题


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?


回答1:


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/



来源:https://stackoverflow.com/questions/8943825/css-background-transition-in-opera-goes-through-black

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!