【问题标题】:Is there a way to have a fallback image rather than displaying the first frame of an animated GIF?有没有办法让后备图像而不是显示动画 GIF 的第一帧?
【发布时间】:2014-07-23 06:07:10
【问题描述】:

我了解,对于不兼容的电子邮件客户端,仅显示动画 GIF 上的第一帧。但是,有没有办法改用不同的后备图片?

【问题讨论】:

    标签: css email html-email animated-gif


    【解决方案1】:

    我很确定 Outlook 是唯一不支持它们的客户端。试试这个:

    <!--[if !mso]><!-->
    ANIMATED GIF
    <!--<![endif]-->
    
    <!--[if gte mso 9]>
    FALLBACK IMAGE FOR OUTLOOK
    <![endif]-->
    

    编辑!修复 outlook.com 在条件 cmets 内吃东西的问题

    <style type="text/css">
    .ecxoutlookcom {
        display:block !important;
    }
    </style>
    
    <img class="outlookcom" src="http://somewhere.com/something.gif" width="100" height="100" alt="something" style="display:none;" border="0" />
    

    Outlook.com 在显示您的 html 之前在您的所有类前面添加 ecx,因此我们可以利用它并显示隐藏的图像。

    【讨论】:

    • 这在 Outlook.com 中不起作用,它只是显示和空单元格:-(
    【解决方案2】:

    您可以将 gif 放入带有背景图片的 div 中,或者将 gif 的第一帧作为备用图片。

    【讨论】:

      猜你喜欢
      • 2014-04-15
      • 1970-01-01
      • 2012-02-04
      • 1970-01-01
      • 1970-01-01
      • 2022-06-14
      • 2012-03-19
      • 2022-01-06
      • 2011-05-30
      相关资源
      最近更新 更多