【问题标题】:CSS background-image "image" not showing up in OutlookCSS 背景图像“图像”未显示在 Outlook 中
【发布时间】:2018-09-10 19:16:34
【问题描述】:

我创建了一个基于 HTML 的电子邮件,其中一个元素定义了“背景图像”属性。在 Outlook 中发送和接收电子邮件时,不显示背景图像。在 Gmail 中收到它时,它会显示出来。我认为这可能与 Outlook 的特定限制有关?这是 HTML 代码:

<div style="text-align: center; background-image:url('http://image.info.geha.com/lib/fe44157075640479741475/m/1/34273cbe-2375-4a73-aec2-5151bf51cf91.jpg'); border-color:#e3e4e5">
 <p style=" align: center; bottom: 50px; left: 100
px;">
  <br>
  <span style="color:#500778;"><span style="font-size:20px;">GEHA EXCLUSIVES</span><br>
  <span style="font-size:18px;">______</span></span><br>
  <br>
  <br>
  <span style="color:#ee7623;"><u><span style="font-size:18px;"><a href="#">Link to website content goes here</a></span></u></span><br>
  <br>
  <span style="color:#ee7623;"><u><span style="font-size: 18px; text-align: center;"><a href="#">Link to website content goes here</a></span></u></span><br>
  <br>
  <span style="display: none;">&nbsp;</span><span style="color:#ee7623;"><u><span style="font-size: 18px; text-align: center;"><a href="#">Link to website content goes here</a></span></u></span><br>
  <br>
  <br>
  <br>
  <span style="display: none;">&nbsp;</span></p></div>

这是 Outlook 的渲染:

这是 Gmail 的渲染图:

有什么想法吗?

【问题讨论】:

    标签: email outlook html-email


    【解决方案1】:

    Outlook 2000-03 支持背景图像,因为它们使用 Internet Explorer 作为其呈现引擎。然而,在 Outlook 2007-16 中,他们改用了 Microsoft Word,这让他们非常头疼。

    除非您使用 VML,否则 Outlook 07-16 将不支持背景图像。 Campaign Monitor 有一个不错的工具来构建该代码:https://backgrounds.cm/

    另一个选择是在你的 div 上使用 bgcolor 属性。 Outlook 07-16 是唯一仍支持该功能的电子邮件浏览器。所有其他浏览器都将使用您的背景图像。你不会有圆角,但你的灰色背景会在那里。

    有关哪些浏览器支持什么的任何其他问题,请使用此列表:https://www.campaignmonitor.com/css/color-background/background-image/

    【讨论】:

      【解决方案2】:

      这是我为解决问题所做的工作

      <!--[if mso]>
          <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" style="width:600;height:257;" arcsize="10%"  fillcolor="#e3e4e5" strokecolor="#ffffff">
      <div style="text-align:center;">
       <p align="center" style="bottom:50px; left:100px;">
      <br>
        <span style="color:#500778;"><span style="font-size:20px;">GEHA EXCLUSIVES</span><br>
        <span style="font-size:18px;">______</span></span><br>
        <br>
        <br>
        <span style="color:#ee7623;"><u><span style="font-size:18px;">Link to website content goes here</span></u></span><br>
        <br>
        <span style="color:#ee7623;"><u><span style="font-size: 18px; text-align: center;">Link to website content goes here</span></u></span><br>
        <br>
        <span style="display: none;">&nbsp;</span><span style="color:#ee7623;"><u><span style="font-size: 18px; text-align: center;">Link to website content goes here</span></u></span><br>
        <br>
        <br>
        <br>
        <span style="display: none;">&nbsp;</span></p></div>
      
          </v:roundrect>
          <![endif]--><!--[if !mso]><!--><div style="text-align: center;">
       <p style="border-radius:25px; -moz-border-radius: 25px; -webkit-border-radius: 25px; border-style:solid; align: center; bottom: 50px; left: 100
      px; background:#e3e4e5; border-color:#e3e4e5">
        <br>
        <span style="color:#500778;"><span style="font-size:20px;">GEHA EXCLUSIVES</span><br>
        <span style="font-size:18px;">______</span></span><br>
        <br>
        <br>
        <span style="color:#ee7623;"><u><span style="font-size:18px;">Link to website content goes here</span></u></span><br>
        <br>
        <span style="color:#ee7623;"><u><span style="font-size: 18px; text-align: center;">Link to website content goes here</span></u></span><br>
        <br>
        <span style="display: none;">&nbsp;</span><span style="color:#ee7623;"><u><span style="font-size: 18px; text-align: center;">Link to website content goes here</span></u></span><br>
        <br>
        <br>
        <br>
        <span style="display: none;">&nbsp;</span></p></div><!-- <![endif]-->
      

      这在 Outlook 中产生了以下内容(别担心紫色条。它只是屏幕截图的一部分,下一个元素):

      【讨论】: