Make Your HTML Email 5½ Times More Mobile Friendly 118
Let's face it, ask most designers what their dream project would be and I bet none would mention designing and coding HTML Email. Designing email has a special place in my heart and I am excited to communicate with people through this challenging medium. So here's 5½ improvements you might consider making when you revamp or greenfield your next template.
Note: This article is a guest post by Josh Rubinstein.
Why should you care?
From the time we rise until the wee hours of the night our smart phones are never far from our opposable thumbs. Despite the proliferation of "umpteen" social networks, email still tops out as one of the most common tasks we perform while on the go or at our desks.
The Concept of "The One Web" represents a shift in thought towards "democratically" publishing online content to a range of devices. At Estately, whenever we talk to our customers, we hear that they read our Saved Search alert emails in the "fleeting moments" when a meeting hasn't quite started or while scarfing down some fruity pebbles cereal in the morning. One of our users told us that in the morning the alarm goes off and, before he's out of bed, he looks through new emails on his iPhone.
The statistics back this up: no matter what service your company provides, your HTML email needs to be optimized for mobile today – according to Campaign Monitor, the iPhone now accounts for almost 15% of their email subscribers. Heck world-wide Smart Phone activation is outpacing births by 3X!
One HTML template for them All
Part of the goal for the HTML Email template design was to only require the use of one template for both mobile, desktop and anything else the industry creates in the next 6 months for that matter! Approaching design and UX challenges with wearing the lens of Progressive Enhancement in mind makes the world a nicer place!
I didn't want to depend on CSS3 media queries for content scaling. I wanted to provide as much support to various devices by using percentage widths and max-widths.
Like-wise when CSS3 is supported I figured the device would be responsive enough for advanced stying and design, as you will discover below with my work-in-progress for Retina display support in HTML email.
We all know that Microsoft Outlook 2010 and 2007 are crap for rendering HTML. WORD! Exhibit A, Exhibit B There's also a few other doosies out there too, checkout Campaign Monitor's Guide to CSS Support in HTML Email Notice there's a lot of those red "X's".
Tip #1: Design all "clicks" to be touch friendly!
Large "Touch Target Sizes" for images, links and buttons will ensure you are a humble champion. There is nothing more frustrating on a slow connection like having to wait for the wrong page to load! Touch Targe Sizes, Accessibility and Ergonomic Guidelines

Tip #2: Stunning images on iPhone Retina Display
First impressions are worth taking seriously even if they are a bit more on the subtle side. Will your subscribers stop receiving your emails if your logo is a bit choppy? Don't compromise if the solution is within reach. I like this approach for supporting the higher resolution displays because all subscribers will see the same content. I aspire to the mantra of Progressive Enhancement. All users will see the ALT text and with images on a logo. If they happen to be using a high resolution display such as the iPhone Retina display they will see a super crisp version of the logo.

HTML
<span style="position: relative; display: block; height: 41px;">
<a href="#" class="logo-link" style="display: block; height: auto;
color: #4C6A8B;font-weight: bold; text-decoration: none;
text-align: left;">
<b></b>
<img style="font-size: 20px; text-align: left; border: none;
font-size: 14px; height: 41px; outline: none; text-decoration: none;
font-weight: bold;" alt="text for image" height="41" width="200"
src="#" />
</a>
</span>
CSS
Note, you will have to update the image paths and dimensions to work with your content and design.
// Yahoo! Mail ignores any styles that use attribute selectors
// this helps override it loading @media queries which it give
// extreme precedence
@media only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
a[class = logo-link] b {
background: url("http://logo.png") no-repeat 0 0;
width: 200px;
height: 41px;
background-size: 100%;
position: absolute;
z-index: 10;
display: block;
}
a.logo-link:after {
content: "Estately";
position: absolute;
top: 0;
text-align: left;
width: 200px;
height: 41px;
display: block;
}
span a[class=logo-link] img#estately {
display: none;
}
}
Tip #3: Providing ALT text for background images
Simply add the CSS below to the media query outlined in Tip# 2. Here we are taking advantage of the CSS Pseudo Class :after and the CSS2 content property to add the ALT text for the high resolution imagery.

CSS
// Yahoo! Mail ignores any styles that use attribute selectors
// this helps override it loading @media queries which it give
// extreme precedence
@media only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
a.logo-link:after {
content: "Alt text for Logo";
position: absolute;
top: 0;
text-align: left;
width: 200px;
height: 41px;
display: block;
}
}
Tip #4: Prevent Webkit & Windows Mobile platforms from changing default font sizes
Mobile Safari has a default text size that's greater than 100%, which can puff up your layout in ways you did not intend. There's lots of advice out there that suggests by setting -webkit-text-size-adjust to none the problem is solved. There has been some good discussion around this topic and it's worth reviewing so you don't blindly implement the following suggestion. If you were to set the property to none desktop WebKit users would loose the capability to "zoom."

CSS
// Corrects font-size on mobile/handheld devices w/o preventing zooming
// in WebKit browsers
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
body {
-webkit-text-size-adjust:100%;
-ms-text-size-adjust:100%;
}
}
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
body {
-webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;
}
}
@media only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
body {
-webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;
}
}
Tip #5: Scaling Images, Responsive Design Approach
Email clients vary in their design and implementation so much. Some are based on antiquated rendering engines and others have umpteen layout options and overloaded "tool belts." It's anyones best guess just how much screen area your actual message will be given. I have choosen to use a combination of percentage widths with max-width settings to achieve a layout where images can scale up to 600 pixels wide and down to 350 pixels. It's not perfect in all clients such as Outlook 2007 and 2010 but the content and utility of the layout are not compromised, while providing a optimal experience for the majority of email clients.

HTML
<body style= "width:100% !important; max-width: 800px; background: #ffffff;
margin: 0 auto; padding: 0; color: #4c4c4c; text-align: center;">
<table border= "0" cellpadding= "0" cellspacing= "0" align= "center"
style= "width:100%; max-width:600px; background: #ffffff;
font-family: Arial, Helvetica, Verdana;">
<tr>
<td>
<a href="#" style="width: 100%; max-width:600px;">
<img src="image.jpg" alt= 6 Photos border= "0"
style= "border: none; font-weight: bold; height: auto;
line-height: 100%; outline: none; text-decoration: none;
text-transform: capitalize;
-ms-interpolation-mode: bicubic; width:90%;
text-align: center; background: #E6F1F8;
font-family: Arial, Verdana; font-size: 16px;" />
</a>
<td>
<tr>
<table>
</body>
Tip #5.5: Make Internet Explorer Smooth
Internet Explorer's default image scaling made your Pentium 266 work, but it today it just makes any scaled image look horrible. Make IE smoother and more sensual by setting image scaling for Internet Explorer to smooth: -ms-interpolation-mode: bicubic; See CSS Tricks for image examples and further reading.
CSS
// If you use width or height tags to resize images in your markup,
// IE will ensure they look incredibly awful unless you use this.
-ms-interpolation-mode: bicubic;
"You have mail" Demo
Hope the improvements and the code samples got you enthusiastic again about HTML Email. My goal is to help you communicate more effectively and provide the best experience possible for your design and subscribers. I certainly developed solutions for my design needs. You may find it necessary to adapt and explore tweaks and new solutions all together. If you come across any improvements or new solutions please let us know!

Guest Author Info
Josh works with the fine people of Estately, a comprehensive online real estate search for home buyers to shop and tour homes. Josh feeds upon the dynamic between design and development finding inspiration from both communities. When he's not in front of the computer, you can find he and his wife working on their Seattle home.
Well done! Great read. Makes me want to throw out the WPtouch plugin.
I like it too!
I have never come across such a thoughtful approach to HTML email. There is way too much compromising taking place in this department. Great post!
Great stuff! HTML email is the bane of most developers, I love the approach. Have you seen HTML5 boilerplate mobile? http://html5boilerplate.com/mobile/ I’d love to see the same thing for html email. :)
You’re in luck :-) http://htmlemailboilerplate.com/
great resource!
http://htmlemailboilerplate.com/
Doh! F5 before posting FAIL…
Useful post, thanks. There will be some who insist the answer is to just use plain text but there has to be a place for graphic and text rich email – you just have to put some thought in to it.
Great article! Loved your writing style and the example illustrations. WORD! ;)
HTML email is the wrong approach. Email should be plain text.
Um, no? HTML emails are highly successful and well tested to be many times better than plain-text emails. Plain-text is valid for a fallback, yes, but your answer and assumption is definitely lacking of any real world metrics proving otherwise.
Thanks for the useful tips and detailed code explaining. Very interesting!
Hello,
I want to hire a pro designer for one of my websites. Someone who has UX ideas. I just can’t seem to find the right people on freelancing websites.
Can you recommend anybody? Please mail me at cyrilgupta@gmail.com if you can.
Hi,
Link of this text is wrong “http://css-tricks.com/ie-fix-bicubic-scaling-for-http://webdesignerwall.com/wp-content/uploads/2011/06/”
Thanks
Jitender
Sorry for mistake.
Test is “See CSS Tricks for image examples and further reading.’
I am trying to implement for my website newsletter. The article really a good tips for me.
Well done! Great post!
Thanks…
Marcus
Great post!!!! I am learning to design web for mobile and I found your post… thanks
The tips on individual mailboxes such as yahoo mail are really helpful. Been trying to send out surf clothing details to folk for ages now and since we stopped using paid 3rd party services a while ago we lost lots of subscribers straight away probably through result of our html table based emails would not showing properly. Media queries are the way forward for us too, we don’t need mobile sites, print.css or mobile apps, just one html5 template and some media query ready css, mobile friendly client side scripting to keep all visitors happy. We just need to work on making our whole site more responsive and cross device compatible now.
Great post about HTML emails for mobiles, considering the popularity of smart phones.
Found a great resource here: http://docs.sencha.com/io/src/ on how to automatically scale images based on devices.
So instead of using , you just prepend the src like so:
The API provides SEVERAL useful options including custom sizes, format conversion, percentage scaling, offset scaling, base64 encoding, callbacks etc. and it’s free!
Sorry my tags got stripped, just go check out the API :)
The Sencha.io image resizing resource looks really sharp. It’s in beta now http://www.sencha.com/products/io/. I would imagine that there will be some fee associated with the service.
My hope is that the W3C will introduce to HTML some way to trigger the download of source images based on the media query. Here’s one discussion about using a “prefixing” model, http://blog.yoav.ws/2011/05/My-take-on-adaptive-images
super Beitrag, danke.
Email in general badly needs standardization similar to the rest of the web.
Great tips though.
Thanks for putting this together! Great tips with code samples; added to my personal must-do-optimizations for new projects.
a little bit OT but did you know that by making
eg.
the phone numberA phones make call onclick :)
Bunch of thanks for sharing this interesting and informative post. Keep it up