Recent Posts

Creating a Simple Responsive HTML Email [Technique 1]--part 3


Creating the Single Column Image
This is a very simple row; we'll simply set an image to be 100% of the width of the email and make sure its height is set to be automatic using CSS.
In our CSS:
Finally we'll add a row of text without the border on the bottom:
To create the footer, we'll add a new row with a table inside. One of the rows will contain another table for our social media icons.
We'll add the requisite styles for our footer to the CSS:
On mobile, it's ideal if the whole button is a link, not just the text, because it's much harder to target a tiny text link with your finger. Because it's not possible to have this work on all desktop clients (padding isn't fully supported on <a> tags), it's something that I add to the mobile version using media queries.
We'll have to strip the colour from the <td> to which it is currently applied, and then apply it back to the <a> tag along with lots of padding.
I will use both max-width and max-device-width in this media query in an attempt to avoid a bug in Outlook.com on IE9.
Now when you tap anywhere on the coloured button on mobile, it's a link!
If you wanted to, you could now start making enhancements to your layout by applying class names to elements that you wish to control, and then creating the new rules inside the media query we just created above.
As an example, we'll turn our unsubscribe link into a button, by adding a class to the link:
and adding the following CSS to the media query:

Email-Footer-MQs

You could also target the .innerpadding, .header and .footer classes to reduce the amount of padding on clients that support media queries.
Finally, as always, make sure you validate (using the W3C validator — you should only get one error for the proprietary 'yahoo' attribute on the body tag) and test really well using live devices and a web preview service like Litmus or Email on Acid.
Enjoy creating responsive emails that look great in every email client!
Share on Google Plus

About Engr. Rokon Khan

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment