Summary of HTML formatting standards for web-based email content

Summary of HTML formatting standards for web-based email content

1. Page requirements

1) Use standard headers and footers

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd” >   
  2. < html   xmlns ="http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type" content = "text/html; charset = utf -8" >   
  5. < title > How to create a webpage-formatted email </ title >   
  6. </ head >   
  7. < body   style =”margin:0;padding:0″ >   
  8. </ body >   
  9. </ html >   

2) Use the gb2312 encoding format uniformly
3) The page display width is 400px-800px, and the height is generally controlled within one screen.
4) The page does not contain js code or flash content (if animation is required, use gif)
5) All images on the page must be absolute addresses
6) The content of the page is best presented in text form.

2. Code requirements

1) Use table to create the page, and the width must be set. Since some attributes of div format are not fully supported by email clients, it is recommended to avoid using it.
2) In the DTD declaration, please change <html xmlns=http://www.w3.org/1999/xhtml> to <html>
3) CSS is not allowed to be called externally or written into the <head> section; all styles are written into the tag.
4) Background images are prohibited.
5) Try to optimize the image as much as possible without affecting the image display effect to ensure that customers can see the image in the shortest possible time when they open the email, thereby increasing the email reading rate.
6) All images must have width, height and alt tags, and the alt content should not be too long and no special characters should appear.
7) Hotspots are prohibited for image links because map markers cannot be clicked normally in Outlook and the URL pointed to by the link cannot be opened.
8) The link opening method is unified as: _blank
9) The correct way to write mailto: Example: <mailto:[email protected]> [email protected]</a>
10) Floating layers are prohibited
11) The code must be clean, unnecessary spaces and carriage returns must be deleted, and the total code size should be less than 50K


3. Email Testing

1) Upload to the server, open the webpage, press ctrl+a, copy and paste into the email
2) Open the webpage locally, copy it directly, and then upload the picture in the email as an attachment.

<<:  Implementation of proxy_pass in nginx reverse proxy

>>:  Sharing experience on MySQL slave maintenance

Recommend

Nginx access log and error log parameter description

illustrate: There are two main types of nginx log...

Let me teach you how to use font icons in CSS

First of all, what is a font icon? On the surface...

Detailed example of concatenating multiple fields in mysql

The MySQL query result row field splicing can be ...

Writing and understanding of arrow functions and this in JS

Table of contents Preface 1. How to write functio...

MySQL database JDBC programming (Java connects to MySQL)

Table of contents 1. Basic conditions for databas...

Unicode signature BOM (Byte Order Mark) issue for UTF-8 files

I recently encountered a strange thing when debug...

Summary of 7 pitfalls when using react

Table of contents 1. Component bloat 2. Change th...

Detailed explanation of how to use Vue self-nested tree components

This article shares with you how to use the Vue s...

Tomcat uses thread pool to handle remote concurrent requests

By understanding how tomcat handles concurrent re...

js to upload pictures to the server

This article example shares the specific code of ...

WeChat applet implements login interface

The login interface of WeChat applet is implement...

SQL implementation of LeetCode (183. Customers who have never placed an order)

[LeetCode] 183.Customers Who Never Order Suppose ...