PNG 图像显示为白色背景,即使它具有清晰的背景
我有一个带有关闭按钮的 Facebox 窗口,我希望它与 uservoice.com 上的完全一样(单击右下角的反馈链接,您会明白我的意思。我已将该图像添加为关闭按钮,但是当它出现在我的浏览器中,它显示白色背景。知道如何使其显示为透明吗?这是我正在谈论的图像:https://i.sstatic.net/jfxC1.png
这是关闭按钮的 CSS:
#facebox .close{
position:absolute;
top:-22px;
right:-24px;
padding:2px;
background:#fff;
}
#facebox .close img{
opacity:0.3;
}
#facebox .close:hover img{
opacity:1.0;
}
I have a facebox window with a close button that i want to be exactly like on uservoice.com (click the feedback link on the bottom right you'll see what i mean. I have added that image as the close button, but when it appears in my browser it shows a white background. The image is supposed to have a clear background. Any idea how to make it show as transparent? Here's an image of what i'm talking about: https://i.sstatic.net/jfxC1.png
Here's the CSS for the close button:
#facebox .close{
position:absolute;
top:-22px;
right:-24px;
padding:2px;
background:#fff;
}
#facebox .close img{
opacity:0.3;
}
#facebox .close:hover img{
opacity:1.0;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在
#facebox .close
上,删除背景:#fff
。这应该就是您需要做的全部。
尽管如此,我看不到您在哪里设置背景图像
。On
#facebox .close
, removebackground: #fff
.That should be all you need to do.
Although, I can't see where you're setting thebackground-image
.可能是这里的
背景:#fff;
。probably the
background:#fff;
here.