While trying to determine as set of best practices for styling HTML email templates, I came across an article on StackOver that provided some helpful advise.
- Inline styles are you best friend. Absolutely don’t link style sheets and do not use a
<style>tag (gmail, for example, strips that tag and all it’s contents).
- Against your better judgement, use and abuse tables.
<div>s just won’t cut it (especially in Outlook).
- Don’t use background images, they’re spotty and will annoy you.
- Remember that some email clients will automatically transform typed out hyperlinks into links (if you don’t anchor
<a>them yourself). This can sometimes achieve negative effects (say if you’re putting a style on each of the hyperlinks to appear a different color).
- Be careful hyperlinking an actual link with something different. For example, don’t type out
http://www.google.comand then link it to
https://gmail.com/. Some clients will flag the message as Spam or Junk.
- Save your images in as few colors as possible to save on size.
- If possible, embed your images in your email. The email won’t have to reach out to an external web server to download them and they won’t appear as attachments to the email.
And lastly, test, test, test! Each email client does things way differently than a browser would do.