tags:

views:

252

answers:

3

In the page found in below link(bg-button.html), I have put round image as a background using styles. But I find a gray background outside the image area. How can I make the background transparent, Please let me know?
Round image as background

+3  A: 

You can add the following style to the button:

background-color: transparent;

Alternatively, use #fff.

Blixt
A: 

Going off what the above poster said, you can generally get around this without thinking about it by just using shorthand, ala:

div#example { background: transparent url("imgurl.png") no-repeat top left; }

Ryan McGrath
Using the shorthand does not require "transparent", as it is the default value. This would achieve the same effect: background: url("imgurl.png") no-repeat 0 0;
Blixt
Yeah, I know. My comment was moreso towards building a pattern so you never have to think about it, it's automatic. ;)
Ryan McGrath
+1  A: 

You must edit the image in a paint program (like GIMP), add a transparency layer, remove the part you don't like with the eraser and save it as GIF or PNG.

Note that IE 6 doesn't handle PNG transparency without some tricks.

Aaron Digulla