In essence this is an email boiler-plate. It has no content, but comes with the outline of the email ready to have content and structure added to it. At the time of creation, it has all the fixes required for the email to work in all browsers and email clients if used correctly. I will endeavour to keep this up to date with the changing times.
There is some basic documentation here, but the best way to learn about the framework is to download the tutorial version of it which comes with example content, and comments throughout the code to explain what each part is doing and why.
There are some major players in the email world that impose all kinds of constrictions on email developers. To start with, Outlook uses MS Word's HTML rendering engine (even they couldn't work ewith IE!), which means CSS, background and text (ultimately all content) behaves in a way we not anticipate from a normal web browser.
Then we come to gmail. Google, industry leaders in everything online, have unfortunately let themselves go with gmail. It has too many quirks to list them all, but the main issues are that it removes all style tags from the html document, meaning any mobile or desktop styles have to be made inline. Of course this means media queries are out in gmail, so any responsive email will just show the desktop version in the gmail ap on any phone. Worse than that, in a botched attempt to mend things of mobile users, the team at gmail have tried to implement their own forced responsive version of emails, which is of course automated, and ugly beyond belief. So there are ever-changing fixes to combat this.
Yahoo! bring their own issue as well. They support CSS, but they won't support media queries. This means all the mobile styles get applied even on desktop. Fortunately they do not support selectors that target attributes, so by using this for all the CSS selectors, it escapes this particular quirk fairly painlessly.
There are a lot more specific issues than these, many of which deserve their own articles which I will try to create. For now, hopefully this sets the backdrop for this responsive framework, and will hopefully make anyone using it aware that many of the weird and wonderful irregularities in the code are probably written with my arms tied behind my back rather than by choice (or mistake).
<td align="left" valign="top" style="font-size:0px; line-height:0px;"> <img src="img.gif" alt="" width="10" height="10" style="display:block" border="0"> /td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<table width="100%" align="left" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"> <table width="200" align="left"...> <tr> <td align="left" valign="top"></td> </tr> </table> <!--[if gte mso 9]> </td> <td align="right" valign="top" > <![endif]--> <table width="200" align="right"...> <tr> <td align="left" valign="top"></td> </tr> </table> </td> </tr> </table>
MainTable
Class to set the width of the outermost table of mobile design. Use this on outer fixed-width tables ONLY. Anything inside this should use be 'width-100'. MainTable can be set to 100%. In px, it is not advised to make it any wider than 320px to avoid iPhone scrolling. It's a separate class so that a fixed width can be applied if required and it won't affect inner table alignments. Defaults to 100%.
<table width="650" align="left" class="MainTable" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"> <table width="500" align="left" class="width-100" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"></td> </tr> </table> </td> </tr> </table>
drop
Resets any elements that are floated on desktop, making them and any child elements 100% in width. This is really useful for section which include fixed-width tables, buttons etc, as they all immediately respond and go to 100%.When you do not want child elements to respond in this way, use "block". It does the same thing, but only to the element to which it is applied
<table width="200" align="left" class="drop" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"></td> </tr> </table>
block
Similar to drop, but to be used when you do not want child elements to be affected. It does the same thing, but only to the element to which it is applied.
<table width="200" align="left" class="block" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"></td> </tr> </table>
width-100
Set the width to be 100% on mobile. Should be used on all tables that need 100% width except the outermost table, where MainTable is more appropriate.
<table width="200" align="left" class="width-100" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"></td> </tr> </table>
width-[90 | 80 | 70 | 60 | 50 | auto]
Set the width to be a percentage based on the class name.
<table width="200" align="left" class="width-50" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="left" valign="top"></td> </tr> </table>
padding-[0 | 5 | 10 | 15 | 20 | 30]
Resets padding on all sides to be the number of pixels in the class name.
<td align="left" valign="top" class="padding-15">Content here receives 15px of padding all round.</td>
padding-horz-[0 | 5 | 10 | 15 | 20 | 30]
Resets padding on the left and right sides to be the number of pixels in the class name.
<td align="left" valign="top" class="padding-horz-10">Content here receives 10px of padding on the left and right.</td>
padding-vert-[0 | 5 | 10 | 15 | 20 | 30]
Resets padding on the left and right sides to be the number of pixels in the class name.
<td align="left" valign="top" class="padding-horz-10">Content here receives 10px of padding on the left and right.</td>
padding-[left | right | top | bottom]-[0 | 5 | 10 | 15 | 20 | 30]
Resets padding on the side specified in the class name to be the number of pixels in the class name.
<td align="left" valign="top" class="padding-bottom-0 padding-left-20">Content here receives 0px of padding on the bottom and 20px of padding on the left side.</td>
font-size-[10 - 30]
Change font-size on mobile. Line-height is also changed to be 120% so that fixed pixel line-height do not scale beyond their line-height.
<td align="left" valign="top" class="font-size-20" style="font-size:30px; line-height:32px;">Font size is 30px on desktop and 20px on mobile.</td>
hide
Hide the element and all descendants on mobile.
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr class="hide"> <td align="left" valign="top"></td> <td align="left" valign="top"></td> </tr> <tr> <td align="left" valign="top"></td> </tr> </table>
show
Show the element and all descendants on mobile.
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td align="left" valign="top" class="show" style="display:none; font-size:0; line-height:0; visibility:collapse; max-height:0; height:0; mso-hide:all;">Some text only for mobile.</td> <td align="left" valign="top">Some text for all versions.</td> </tr> </table>
bold | no-bold
Add or remove bold from text on mobile.
<td align="left" valign="top" class="no-bold" style="font-weight:bold;">Bold on desktop, but not on mobile.</td>
no-background
Remove backgrounds on mobile.
<td align="left" valign="top" class="no-background" background=".../bg.png">Has no background on mobile.</td>
no-border
Remove borders on all sides on mobile.
<td align="right" valign="top" class="no-border" style="border:1px solid #000001;">Has a border on desktop but not on mobile.</td>
align-right
Make content right aligned on mobile.
<td align="left" valign="top" class="align-right">Left aligned on desktop, right aligned on mobile.</td>
align-left
Make content left aligned on mobile.
<td align="right" valign="top" class="align-left">Right aligned on desktop, left aligned on mobile.</td>
center
Center content inside the element the class is applied to.
Note: If a floated element needs to be centered, the center class will need to be applied to the floated element as well as it's parent. Doing this will allow the framework to reset the float.
<td align="left" valign="top" class="center">Text here is left aligned on desktop and centered on mobile.</td>