Notes for creating html emails: Create html emails

Source: Internet
Author: User
Tags all mail

Notes for creating html emails: Create html emails
As there were some requirements for creating front-end html emails in python, I also had some experiences in this process.Do not contact cssFor more information about css support, see http://www.campaignmonitor.com/css. We can see that the css style of the page is set through the tag attribute or style attribute of html. In the development of HTML email, there is a golden rule:If an attribute exists in HTML, the label attribute is used instead of the CSS style.. 2.Use table layoutWhy should we use the old table layout? Because the mail client generally adopts the original parsing method, we can use the mail client as the Internet Explorer 6. If div is used and position or float is used for layout, the position attribute is in Outlook07/10/13, Yahoo! Mail and Google Gmail are not supported. The float attribute is not supported on both the Outlook client and the webpage, so the compatibility is not friendly. In some cases, the page will become ugly. Therefore, it is best to adopt the nested layout of the ancient table, and the omnipotent center can be achieved through align = "center.Set alt attribute and border = 0 for all img labelsThe alt attribute is set to prevent the image from being displayed at least with text instructions, so that users can understand the meaning. Setting border = 0 makes it unclear why you want to set border = 0, but it does make the image display in more cases. Of course, it is still not supported in some cases. For example, if the gmail webpage side is sent to the QQ mailbox webpage side (the image still cannot be displayed. Check the source code and find that the src and alt attributes of the img Tag are harmonious) at the same time, you can set the display: block for img to fix the blank spacing under some email client images. In addition, if you need to use images, it is recommended that you upload images to the server or directly use base64 for small images. 4.When setting background-color, always remember to use the complete six hexadecimal codes. If you use three shorthand characters, it is not always valid.. Although the background-color attribute is supported by all email systems, remember to use six complete hexadecimal codes when assigning values. Even if it is black, do not use #000, but #000000 5.Use padding instead of marginThe margin attribute does not support padding on the web page of Outlook. It supports all mail systems. At least I have not used padding to avoid incompatibility. However, I think it is okay to use the table layout on the Internet. But if div layout is used, the padding will become uncontrollable, which I have not tried yet. This is some of my previous experiences in html emails, and I will continue to add more in the future.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.