【发布时间】:2019-11-18 23:52:28
【问题描述】:
我有一个透明背景的 gif 图像,您可以在我的桌面上看到:
但是当我在我的 html 代码中使用它时,会得到白色背景。 我已经在 stackoverflow 和谷歌首页的其他网站中测试了背景 css 属性和回复。 这是我的代码:
<img src="/content/elecomp98/pahbad.gif" style="position: absolute;top: 50px;left: 0;width: 250px;">
<div style="width: 250px;height: 280px;background: url(/content/elecomp98/pahbad.gif);position: absolute;left: 0;top: 50px;background-size: cover;display: none;"></div>
【问题讨论】:
-
寻求代码帮助的问题必须包含重现它所需的最短代码在问题本身中最好在Stack Snippet 中。见How to create a Minimal, Reproducible Example。 我们需要 ACTUAL 图片。
-
当然。但它的问题很简单,没有其他详细信息。
-
我添加了另一张更清晰地显示问题的图片。
-
另请注意,“Pahbad.gif”与“pahbad.gif”不同。
-
@Paulie_D 你救了我的命。添加此答案,以便我确认。