Reputation: 105
I have an div
element in the web page and I'm going to set both background color and background image for it. The image has a transparent background, and I want the background color to be shown under the image. Is it possible?
Upvotes: 5
Views: 17217
Reputation: 2654
Yeah 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;}
the #ffffff
is the color that you want behind your image.
Very important that your image extension support transparency, use .png or .gif
Upvotes: 16