IOS背景半透明渐变问题
问题描述:
给一个层设置半透明的背景,使用 background:linear-gradient(to bottom, transparent, #ffffff),其中使用transparent的时候
在安卓上显示正常(白色半透明,但ios上显示透明渐变会出现灰色,所以不能直接写成transparent。
解决方案:
// 正确写法
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%) 或
background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1))