无法在 Outlook 中正确显示 html 电子邮件签名

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14460470/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 05:08:39  来源:igfitidea点击:

Trouble getting html email signature to display properly in Outlook

htmlcssoutlook-2010email-clientsignatures

提问by Dom Walker

I have created myself a simple email signature in html, he's the code:

我在 html 中为自己创建了一个简单的电子邮件签名,他是代码:

<html>

<!-- Company logo goes here -->
<div id="far_left" 
    style="width: 50px; 
           height: 50px;
           float: left;
           margin-right: 10px;">
    <img src="logo.png" />
</div>

<!-- Name and occupation goes here -->
<div id="top" 
    style="height: 25px;">
    <span style="font-family: Arial, Verdana, 'Sans Serif'; font-size: 22; color: #464646;"><strong>Dean Grobler</strong>, Programmer</span>
</div>

<!-- Website link and email adress goes here -->
<div id="bottom" 
    style="font-family: Arial, Verdana, 'Sans Serif';
           font-size: 14px;
           color: #464646;
           padding: 5px;
           height: 25px;">
    <a href="http://www.deangrobler.com" style="text-decoration: none; color: #84d5f6">www.deangrobler.com</a> | 
    <a href="mailto:[email protected]" style="text-decoration: none; color: #84d5f6">[email protected]</a> 
</div>

In thunderbird, and my browsers it displays correctly:

在 Thunderbird 和我的浏览器中,它正确显示:

enter image description here

在此处输入图片说明

But alas in Outlook 2010 it does not:

但可惜在 Outlook 2010 中它没有:

enter image description here

在此处输入图片说明

If it's using the same rendering engine that IE uses, and I bet you it does, I'm not too surprised this is happening.

如果它使用与 IE 使用的渲染引擎相同的渲染引擎,而且我敢打赌它确实如此,我不会太惊讶发生这种情况。

Any ideas?

有任何想法吗?

回答by Dom Walker

Email clients do not render html in the same way that browsers do. When creating html emails it is much better to use tables. I know this is going against all modern web design, but they are supported by a lot more email clients. Here is a link to the css properties and which clients they are supported by.

电子邮件客户端不会以与浏览器相同的方式呈现 html。创建 html 电子邮件时,最好使用表格。我知道这违背了所有现代网页设计,但它们得到了更多电子邮件客户端的支持。这是 css 属性及其支持的客户端的链接。

http://www.campaignmonitor.com/css/

http://www.campaignmonitor.com/css/