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
在下面链接(bg-button.html)中找到的页面中,我使用样式将圆形图像作为背景。但我发现图像区域外面有灰色背景。如何让背景透明,请告诉我?作为背景的圆的图象
3 个解决方案
#1
You can add the following style to the button:
您可以将以下样式添加到按钮:
background-color: transparent;
Alternatively, use #fff
.
或者,使用#fff。
#2
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.
您必须在绘画程序(如GIMP)中编辑图像,添加透明层,使用橡皮擦删除您不喜欢的部分并将其另存为GIF或PNG。
Note that IE 6 doesn't handle PNG transparency without some tricks.
请注意,IE 6在没有一些技巧的情况下无法处理PNG透明度。
#3
Going off what the above poster said, you can generally get around this without thinking about it by just using shorthand, ala:
关闭上面的海报所说的,你通常可以通过简单地使用速记来解决这个问题,ala:
div#example { background: transparent url("imgurl.png") no-repeat top left; }
div #example {background:transparent url(“imgurl.png”)no-repeat left left; }
#1
You can add the following style to the button:
您可以将以下样式添加到按钮:
background-color: transparent;
Alternatively, use #fff
.
或者,使用#fff。
#2
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.
您必须在绘画程序(如GIMP)中编辑图像,添加透明层,使用橡皮擦删除您不喜欢的部分并将其另存为GIF或PNG。
Note that IE 6 doesn't handle PNG transparency without some tricks.
请注意,IE 6在没有一些技巧的情况下无法处理PNG透明度。
#3
Going off what the above poster said, you can generally get around this without thinking about it by just using shorthand, ala:
关闭上面的海报所说的,你通常可以通过简单地使用速记来解决这个问题,ala:
div#example { background: transparent url("imgurl.png") no-repeat top left; }
div #example {background:transparent url(“imgurl.png”)no-repeat left left; }