CSS 背景图像 "image" 未在 Outlook 中显示
CSS background-image "image" not showing up in Outlook
我创建了一个基于 HTML 的电子邮件,其中一个元素定义了 "background-image" 属性。在 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;"> </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;"> </span></p></div>
这是 Outlook 的效果图:
这是 Gmail 的渲染图:
知道这是为什么吗?
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/
这是我为解决问题所做的工作
<!--[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;"> </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;"> </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;"> </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;"> </span></p></div><!-- <![endif]-->
在 Outlook 中产生了以下内容(不要介意紫色条。它只是屏幕截图的一部分,下一个元素):
我创建了一个基于 HTML 的电子邮件,其中一个元素定义了 "background-image" 属性。在 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;"> </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;"> </span></p></div>
这是 Outlook 的效果图:
这是 Gmail 的渲染图:
知道这是为什么吗?
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/
这是我为解决问题所做的工作
<!--[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;"> </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;"> </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;"> </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;"> </span></p></div><!-- <![endif]-->
在 Outlook 中产生了以下内容(不要介意紫色条。它只是屏幕截图的一部分,下一个元素):