问题
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