html gif 具有透明背景但在 img 标签和 css 背景属性中变白

html gif has transparent background but gets white in img tag and css background attribute

我有一张透明背景的 gif 图片,你可以在我的桌面上看到:

但是当我在 html 代码中使用它时,背景变成白色。 我已经测试了背景 css 属性以及 Whosebug 和其他站点 google 主页上的回复。 这是我的代码:

<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>

请注意“Pahbad.gif”与“pahbad.gif”不同。

图片网址为 case-sensitive.

Cascading Style Sheets (CSS) is not case sensitve. However, font families, URLs to images, and other direct references with the style sheet may be.

我建议您链接了错误的图片。