This has to do with the way browsers render transparent
.
For most browsers,
transparent === rgba(255,255,255,0)
But Safari renders it as
transparent === rgba(0,0,0,0)
So if you have a gradient from transparent
to white
(or rgba(255,255,255,1)
), for most browsers you're only changing the alpha from 0 to 1 along the gradient.
But for Safari, you're changing the alpha from 0 to 1 and the color from 255
to 0
, so you get a gradient of greys.
This drove me crazy for a while.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…