【发布时间】:2016-05-02 18:29:45
【问题描述】:
我在我的 html 中包含了一个 gif 图片
<div id="overlay-inAbox8">
<div class="wrapper" id="overlay-inAbox8wrapper">
<img id="loading-gif" src="{% static 'loading.gif' %}" />
</div>
</div>
css:
#loading-gif{
width:100%;
}
#overlay-inAbox .wrapper {
text-align: center;
}
#overlay-shade {
display: none;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 10;
background-color: #000;
}
.overlay {
border: 3px solid #000;
border-radius: 25px;
background-color: #fff;
position: fixed;
left: 0;
width: 50%;
z-index: 11;
color: #000;
}
.ie7 .overlay {
height: 200px;
}
.overlay .wrapper {
padding: 15px 30px 30px;
text-align: center;
}
#overlay-inAbox8 {
position: fixed;
top: 50%;
left: 50%;
width: 190px;
height: 90px;
line-height: 90px;
text-align: center;
margin-top: -50px;
margin-left: -100px;
display: none;
}
动画 gif 在 Chrome 中显示为静态图像,但在 Firefox 和 ie 中正确显示。
当我尝试在 chrome 中仅显示 gif 时,它工作正常。
【问题讨论】:
-
我认为这不是 CSS 的问题,而是您拥有的这个有趣的链接:src="{% static 'loading.gif' %}"
-
@RachelS 这是一个 django 模板,所以路径是这样指定的。它正在正确渲染
标签: html google-chrome animated-gif