views:

47

answers:

1

Can I combine 3 gradients into one -webkit-gradient? I want to have an image that has a radial gradient for the "background" and "middle-ground" and a linear gradient for the "foreground". Is this possible?

+1  A: 

Yes, it is possible. Use three overlapping elements (divs are as good as any other), one each for the back-, mid-, and foregrounds. Style each one with its own gradient, using transparent as the underlying color, and the others will show through.


Edit: here's a two-layer version that should help get you started: http://jsbin.com/awali (requires a Webkit browser)

Matt Ball
The link is bad. The page displays, "document.getElementById("hello").innerHTML = "This URL does not have any code saved to it.";"
AtlasBody
@Atlas: you're right! Sorry about the broken link, I must have mis-copied it. It's fixed now, though.
Matt Ball