Responsive email template

Finally I got some time and implemented responsive email templates in this blog. Some of you probably already have seen these changes in September newsletter. To be honest, even in a nightmare, I couldn’t imagine so many hacks in order to solve such a very simple task as responsive email templates. Which appeared to be simple on a first glance. Click Read More to find out the list of problems I have encountered and ways to resolve them. Check out an example of responsive email template attached as well. By writing this post, I’m starting a new set of posts I plan to write just to share some know-hows I have learned or achieved, just to keep them somewhere 🙂

Problem: a post client strips away media queries from email
Solution: use tables (yes, those old html-tables)

Problem: a post client stripes away external CSS styles
Solution: inline your CSS while coding

Problem: a post client ignores any <style> or <link> in the section
Solution: add a style to each html element while coding

Problem: a post client doesn’t support padding, margin, fload and paragraph
Solution: use a nested table based layout with each TD tag carrying padding and margin

Problem: a post client styles links as blue and underlined by default

<a href="" style="text-decoration:none; color:#00001b">Read More</a>

Finally, a single column responsive email template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--[if !mso]><!-->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if (gte mso 9)|(IE)]>
<style type="text/css">
  table {border-collapse: collapse;}
<body style="margin: 0 !important;padding: 0;>
  <center style="width: 100%;table-layout: fixed;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;">
    <div style="max-width: 640px;margin: 0 auto;">
      <!--[if (gte mso 9)|(IE)]>
      <table width="640" align="center">
      <table align="center" style="Margin: 0 auto;width: 100%;max-width: 640px;">
          <td style="text-align: left;">
            <table width="100%">
      <!--[if (gte mso 9)|(IE)]>

Here is a “before” example:

And “after” for desktop mode:

You can see an example of “after” for mobile at the beginning of the post.

Stay tuned. Get post excerpts, news and other perks not included in RSS, Feedly or somewhere else.

Join 258 other followers and receive monthly newsletter

Ivan Grigoryev's Blog
Living in New Zealand. Blogging about the country, beautiful places, everyday life.
Do a skydive - halfway completed; get 1400 - still working on; reach 300kph - completed by 96.6%