---
title: "HTML邮件模板心得"
author: "IT_hack"
date: "2013-05-16T17:24:06Z"
tags: []
categories: ["Web前端"]
slug: "html"
draft: false
lastmod: "2013-05-16T17:24:06Z"
id: 1870500
url: "https://w3cking.iteye.com/blog/1870500"
---

个HTML邮件模板禁忌：

1\. 结构尽量简单，最好使用table布局

可以保证在CSS样式失效、或者html被禁用的情况下最大程度的还原布局和样式。

2\. 不要使用&lt;head&gt;标签

一般会被过滤掉。

3\. 不要使用JavaScript和Flash

正常情况下这个是绝对被过滤的。。

4\. 使用内联CSS样式，不要引入外部CSS文件，不要使用&lt;style&gt;标签

Gmail等不支持style标签。

5\. CSS禁忌：不要使用绝对定位，不要使用背景图片，不要使用半透明，不要使用IE滤镜和CSS表达式，不要使用CSS3属性……

6\. 图片要添加alt属性，保证在禁用图片的情况下传递有效信息

7\. 图片添加宽高属性

8\. 不要试图使用iframe引入外部页面

9\. 尽量精简代码，减少图片数量和体积

10\. 一般使用UTF-8编码

### 邮件客户端/服务商对CSS支持情况

 

转自[baidu](http://hi.baidu.com/qingsongkkk/blog/item/adc92502675cc48ae850cdd4.html/cmtid/accf14969de6ea10d31b7041)，来源未知，未完全验证

[![](http://www.oncoding.cn/wp-content/uploads/2010/11/1-300x228.jpg "1")](http://www.oncoding.cn/wp-content/uploads/2010/11/1.jpg)

[![](http://www.oncoding.cn/wp-content/uploads/2010/11/2-300x222.jpg "2")](http://www.oncoding.cn/wp-content/uploads/2010/11/2.jpg)

[![](http://www.oncoding.cn/wp-content/uploads/2010/11/3-300x212.jpg "3")](http://www.oncoding.cn/wp-content/uploads/2010/11/3.jpg)

[![](http://www.oncoding.cn/wp-content/uploads/2010/11/4-265x300.jpg "4")](http://www.oncoding.cn/wp-content/uploads/2010/11/4.jpg)

[![](http://www.oncoding.cn/wp-content/uploads/2010/11/5-300x140.jpg "5")](http://www.oncoding.cn/wp-content/uploads/2010/11/5.jpg)