HTML电子邮件的文档类型 [英] Doctype for html email

查看:88
本文介绍了HTML电子邮件的文档类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪种DOCTYPE是HTML电子邮件的正确选择?

Which DOCTYPE is the right one for HTML email?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


推荐答案

这些天来,DOCTYPE声明中的区别很小html电子邮件。尽管只是次要的,但仍建议您在发送前通过Acid或Litmus上的Email或任何其他测试软件对您的电子邮件进行测试,以确保跨客户端兼容性并发现任何无法预料的怪癖。

There is only minor differences these days in DOCTYPE declarations in html email. Although only minor, it is still recommended to test your emails via Email on Acid or Litmus or any other testing software prior to a send to ensure cross client compatibility and to find any unforeseen quirks.

如果您不声明doctype或body标签,则会带来更大的问题,它确实会在某些客户端上破坏电子邮件的不同部分。

The larger issues comes with if you do not declare a doctype or body tag, it can really screw up different parts of the email on certain clients.

如今,最流行的DOCTYPE是HTML 5 doctype(<!DOCTYPE HTML> ),它很少出现打h。最受欢迎/最安全的文档类型曾经是<!DOCTYPE html PUBLIC-// W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/ xhtml1 / DTD / xhtml1-transitional.dtd> 文档类型。仍然可以使用,但是可能会限制您电子邮件的其他功能,因为它引用的是旧版HTML。

The most popular DOCTYPE nowadays is the HTML 5 doctype (<!DOCTYPE HTML>) which is used with very little hiccups. The most popular/safest doctype used to be the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> doctype. This can still be used, but may limit different capabilities of your email, as it is referencing an older version of HTML.

有关石竹的更多信息,请参阅此论坛帖子。深度信息: https://litmus.com/community/discussions/39-explanation-of-doctype-html-attributes-and-meta-tags-in-email-head

See this forum post in litmus for more in-depth information on this: https://litmus.com/community/discussions/39-explanation-of-doctype-html-attributes-and-meta-tags-in-email-head

这篇关于HTML电子邮件的文档类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆