【问题标题】:Gif image is not working in chrome, but working in firefox and ieGif 图像不能在 chrome 中工作,但在 Firefox 和 ie 中工作
【发布时间】: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


【解决方案1】:

您是否检查过您的 firefox 和 chrome 的自动重复值..... 默认情况下,Firefox:自动重复“开”。 默认情况下,Firefox:自动重复“关闭”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-21
    • 1970-01-01
    • 2014-05-24
    • 2012-11-03
    • 1970-01-01
    • 2015-02-12
    • 2017-06-07
    • 1970-01-01
    相关资源
    最近更新 更多