I'm getting a weird issue trying to use multiple backgrounds. The basic effect I want to have is a gradient background on the edges and a transparent background in the middle. Here's the really basic code:
background: transparent, linear-gradient(45deg, #f06, yellow);
background-size:50% 50%, 100% 100%;
background-position: 50% 50%, 0 0;
background-repeat: no-repeat;
I'm using dabblet to play around with it. If I use that code I get nothing (I replaced transparent
with green
take make sure I'll be able to see it): http://dabblet.com/gist/5339331
However if I reverse the backgrounds (backgound: linear-gradient(45deg, #f06, yellow), green;
) it works perfectly as expected, except of course it's in reverse: http://dabblet.com/gist/5339291
What's going on here? Why would it work one way and not the other? I also tried replacing the gradient with blue
to make it simple and it just doesn't work: http://dabblet.com/gist/5339396
FYI I'm testing in Chrome 27 and I get a yellow !
with the warning Invalid property value.
EDIT: Here's a better (yet still broken) example of the effect I'm going for. In this example, there are four pieces, each with their own gradient background. Ideally I'd have one piece because
it would allow for a gradient that looks right.
this looks horrible and doesn't play well on mobile devices.
it would be nice to avoid the extra fixed/absolute divs if possible