Building HTML emails, can I put styles in the header section or do I have to use inline styles?

偶尔善良 提交于 2019-12-04 21:27:52

Unfortunately, for best compatibility the answer is yes, you need to inline your styles. You'll also have to use tables for markup.

Tools such as premailer, which inline the styles for you, help alleviate a lot of headaches though.

CampaignMonitor provides a good list of CSS support.

I recommend htmlemailboilerplate

To be the most compatible with the widest range of email clients you'll want to use inline styles. I always try to think like a web programmer from 1995 when developing email templates.

Tables - YES! Transparent PNGs - Nooooooooooo.

Thankfully there are a lot of tools out there to help in building email templates that work across most email clients. MailChimp's Email Blueprints project had a lot of templates you can start with.

You CAN use CSS styling while in development (the MailChimp templates do this). But before you send the email you'll need to run it through an HTML Inliner tool to put all the CSS styles inline. MailChimp does this automatically if you use their service. Or Premailer works great too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!