Question

I have a div with a background image positioned on the top right and a background color for the remainder, is it possible to use a linear gradient instead of the color?

Was it helpful?

Solution

Yes, possible. You can use the following style definition:

background-image: url(/images/mybg.png) top right, linear-gradient(top, #444444, #999999);

Also, see this post for a cross browser compatible solution.

OTHER TIPS

You can also create a gradient bitmap, cut a thin slice and use it as a background image. Below I have a thin horizontal image than blends from left to right, it repeats vertically:

style="width: 110px; background-image: url(BlendLeft.ico);
                background-repeat: repeat-y;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top