CSS 渐变不透明度(非背景)
我知道如何使用 Alpha 创建渐变背景,但我想要的是让我的元素具有渐变不透明度。我正在寻找的是让我的 div 及其所有子元素都应用不透明度渐变。
有办法做到这一点吗?我只需要它在 webkit 中工作,因为它只是一个内部项目。
I know how to create gradient backgrounds with alpha, but what I want is to have my element have a gradient opacity. What I'm looking for is to have my div and all it's children have the opacity gradient applied to them.
Any way to do this? I only need it to work in webkit, as it's an in-house only project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
制作渐变背景,但使用 rgba 颜色。最后一个值将指定不透明度,1.0 表示完全不透明,0.0 表示完全透明。
上面是蓝色到透明的渐变。
Make a gradient background, but use rgba colors. The last value will specify the opacity, 1.0 for fully opaque, 0.0 for fully transparent.
Above is a blue to transparent gradient.
最简单的就是将其设为PNG。或者使用 webkit 掩码!
http://css-tricks.com/webkit-image-wipes/
The easiest thing is to make it a PNG. Or use a webkit mask!
http://css-tricks.com/webkit-image-wipes/