CSS 径向渐变与交集的并集
我试图让两个径向渐变在同一个 DOM 元素上渲染,但看起来它们正在渲染两个渐变的交集而不是并集(这就是我想要的)。
示例: http://jsfiddle.net/VUzLS/1/
为了节省您一些时间(如果有)没有重叠,它不会渲染两个渐变,它不会渲染任何内容,因为没有交集。
有没有办法让这个渲染两个渐变的并集?
编辑:这应该说明我想要什么。我希望红色椭圆定义的渐变占据整个白色部分,但现在它们只占据红色椭圆定义的区域的交集。
I'm trying to get two radial gradients to render on the same DOM element but it seems like they're rendering the intersection of the two gradients rather than the union (which is what I want).
Example: http://jsfiddle.net/VUzLS/1/
To save you some time, if there is no overlap, it does not render both gradients, it will render nothing as there is no intersection.
Is there a way to make this render the union of the two gradients?
Edit: This should illustrate what I want. I would like the gradients defined by the red ellipses to take up the entirety of the white section but right now they're only taking up the intersection of the area defined by the red ellipses.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 css3 渐变 的一个很好的概述,
我发现语法非常混乱并且我不确定你想实现什么目标。
这是示例的更新版本,它显示了带有内部框阴影的多色径向渐变,以显示一些其他 css3 绘图想法。您可以使用 rgba 颜色来实现透明度。
也许你可以画出你的追求的图画。
Here is a pretty good overview of css3 gradients
I find the syntax pretty confusing and am not sure what you are trying to accomplish.
Here is an updated version of your example that shows multi-color radial gradients with an inner box shadow to show some other css3 drawing ideas. You can use rgba colors for transparency.
perhaps you could draw a picture of what your after.