Display background color through transparent background image

I have an element divon a webpage, and I'm going to set both the background color and the background image for it. The image has a transparent background, and I want the background color to appear below the image. Is it possible?

+5
source share
1 answer

Yes, you only need to have an image with a transparent background, and after that you use this

body {background:#ffffff url('img_tree.png') no-repeat right top;}

#ffffff - This is the color you want behind your image.

It is very important that your image extension supports transparency, use .png or .gif

+15
source

All Articles