HTML电子邮件:表或divs? [英] HTML email: tables or divs?
问题描述
html电子邮件时事通讯的HTML / CSS需要采用表格格式,还是可以使用具有同等保证的DIV,它将很好地显示交叉电子邮件客户端?我已经下载了一些模板,以了解它们是如何完成的,并以此为基础,并且它们似乎都使用表格。
任何洞察力都非常感谢,谢谢!
当涉及到电子邮件HTML时,请注意web开发中的所有最佳实践都离开了这个窗口。为了保持外观一致,您应该:使用基于表格的布局
< style>
-tags被许多客户端丢弃。 使用< html>
,< head>
和< body>
- 无论如何,它们将被大多数客户抛弃。- http://articles.sitepoint.com/article/code-html-email-newsletters
- http://dennisdeacon.wordpress.com/2008/06/09/top-10-email-best -practices /
- http://www.catswhocode.com/blog/best-practices-for-coding-html-emails
Does the HTML/CSS for an html email newsletter need to be in table format, or can I use DIVs with equal assurance it will display well cross email-client? I've downloaded a number of templates to see how they're done, upon which to base my own, and they all seem to use tables.
Any insight much appreciated, thanks!
When it comes to email HTML, note that all best practices from web development goes out the window. To make the look consistent, you should:
- Use table based layouts
- Use the old-school attribute styling for tables
- Use ONLY inline-styles, and only very simple such.
<style>
-tags are discarded by many clients. - Skip using
<html>
,<head>
and<body>
- They will be discarded by most clients anyway. - If you embed images, try to make sure that the e-mail looks decent even if images are not loaded. Many clients require the user to mark the email as "safe" before displaying images.
You can read more detailed versions of the above points here:
- http://articles.sitepoint.com/article/code-html-email-newsletters
- http://dennisdeacon.wordpress.com/2008/06/09/top-10-email-best-practices/
- http://www.catswhocode.com/blog/best-practices-for-coding-html-emails
这篇关于HTML电子邮件:表或divs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!