简体   繁体   English

我应该使用HTML 4.0标记我的电子邮件模板吗?

[英]Should I use HTML 4.0 mark up for my email templates?

A designer coded an html template using CSS best practices. 设计师使用CSS最佳实践编写了一个html模板。 I want to use this template as an email newsletter template, but I've heard people say hotmail, yahoo and gmail offer limited support for CSS. 我想将此模板用作电子邮件新闻稿模板,但我听说有人说hotmail,yahoo和gmail对CSS的支持有限。

Am I supposed to re-code these templates using table layouts and font tags? 我应该使用表格布局和字体标签重新编码这些模板吗?

The short answer is Yes . 简短的回答是肯定的

You're going to get the best compatibility across webmail accounts & email clients by using the most basic and dumbed down HTML possible. 通过使用最基本和最简单的HTML,您将获得跨Webmail帐户和电子邮件客户端的最佳兼容性。

  • Don't use any CSS files or <style> tags. 不要使用任何CSS文件或<style>标签。 Do everything inline. 一切内联。
  • Handle positioning with nested tables that have explicit widths 使用具有显式宽度的嵌套表处理定位
    • I make heavy use of HTML comments in these situations to make sure I don't get confused about where I am in the layout. 我在这些情况下大量使用HTML注释,以确保我不会对布局中的位置感到困惑。
  • All text should be surrounded by <font> tags with the font style information. 所有文本都应该包含带有字体样式信息的<font>标签。
  • Images should have explicit widths & heights. 图像应具有明确的宽度和高度。
    • This helps the email retain its proper layout when images are blocked. 这有助于电子邮件在图像被阻止时保留其正确的布局。

I usually test on a minimum of the following: 我通常会测试至少以下内容:

  • Outlook 2003 Outlook 2003
  • Outlook 2007 Outlook 2007
    • Most of your headaches will come from here. 你的大部分头痛都来自这里。
  • Thunderbird 雷鸟
  • Entourage (OSX version of Outlook) 随行人员(OSX版本的Outlook)
  • Gmail Gmail的
  • Hotmail Hotmail的
  • Yahoo Mail 雅虎邮箱

You're usually in pretty good shape if you get something that shows up properly on all of those. 如果你能得到适合所有这些东西的东西,你通常会处于非常好的状态。

We use Exact Target and they have an HTML preview feature but it's not perfect. 我们使用Exact Target并且它们具有HTML预览功能,但它并不完美。 I've run into a lot of situations where an email looked good in the preview but still came through broken in Outlook 2007. 我遇到过很多情况,其中电子邮件在预览中看起来不错,但在Outlook 2007中仍然存在问题。

Mark above said everything that you need to do to develop email templates (it's the 90's all over again), but I wanted to add one last thing: 上面标记说你需要做的所有事情来开发电子邮件模板(这是90年代的重复),但我想添加最后一件事:

http://www.email-standards.org/ is a great resource to see how different email clients interpret HTML and CSS. http://www.email-standards.org/是一个很好的资源,可以看到不同的电子邮件客户端如何解释HTML和CSS。

To build on what Mark said: 以Mark所说的为基础:

If at all possible, avoid using CSS at all (though, it's usually alright for things like text). 如果可能的话,完全避免使用CSS(但是,对于像文本这样的东西,它通常是正常的)。 Use tables for all positioning, empty <td> elements for padding/smaller positioning bits. 使用表格进行所有定位,将空<td>元素用于填充/较小的定位位。

And even with all this, it's only going to look perfect in a few email programs/sites. 即便如此,它只会在一些电子邮件程序/网站中看起来很完美。 HTML email is, I'm fairly confident in saying, utterly impossible to do in such a way that it shows up perfectly in all mail clients/apps. HTML电子邮件,我相当自信地说,完全不可能在所有邮件客户端/应用程序中完美显示。

You'll have to go back to stone-age HTML to get HTML emails to work out as Mark suggested. 你需要回到石头时代的HTML来获取HTML电子邮件,就像马克建议的那样。 All styles inline in the html. 所有样式都内嵌在html中。 No STYLE tags or external stylesheets. 没有STYLE标签或外部样式表。

MailChimp and CampaignMonitor both offer excellent free HTML email templates. MailChimpCampaignMonitor都提供优秀的免费HTML电子邮件模板。 They also both offer email testing services that send your html emails to several different email clients and then send you screenshots of the results. 他们还提供电子邮件测试服务,将您的HTML电子邮件发送到几个不同的电子邮件客户端,然后向您发送结果的屏幕截图。

use div tag with fixed height/weigth and put all your HTML in there. 使用固定高度/重量的div标签,并将所有HTML放在那里。 It would look the same in most clients. 在大多数客户端看起来都一样。 Iv'e tried it before and it works fine. 我之前尝试过,它工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM