How to use CSS3 Animation in email

10 Jul 2012

Although support for CSS in email clients is patchy at best (and a nightmare at worst) we can still use some of the newest features provided by CSS3 as long as we can provide suitable alternatives for the less capable inboxes.

animated-button-working

Here is an example of a special call to action that will not only animate but also display fully even when images are turned off.


How it’s done


This CSS must be placed in your html documents head as internal CSS it will not work if it is put inline. Vendor prefixes have been used for the gradient to ensure it displays in iCloud Mail no matter what web browser is used. The animation will only work in iOS devices so I have only used the -webkit prefix.

               Coding-1

The HTML for the button <a> must sit within a table cell to fix a padding bug in Outlook. I also included much of the CSS for the button inline to ensure the colour, border and text would be formatted correctly even in less capable email clients.

               Coding-2

A note on support


This code will not display the same in every inbox.  It will create a button of roughly the same size but the animation and other style features will change across different email clients.

iOS5, iCloud Mail
CSS3 border-radius, gradient & box-shadow. Animations work!

animated-button-working

Thunderbird 9
CSS3 border-radius & gradient

Thunderbird

Gmail, Hotmail
CSS3 border-radius & gradient

Gmail-and-Hotmail

Outlook 2010, Yahoo! Mail
CSS3 border-radius & gradient

 Outlook-and-Yahoo

 

 


Also known as @CaptainInbox Andy joined Pure360. He was instrumental in developing account management at Pure360 before stepping up to specialise in deliverability and creative strategy where he works to further Pure360 customers' experience and the performance of their campaigns.

Follow on Google+


Comments


Our Bloggers

Adrian BrandishJames Brooker - Mid weight graphic designerAbi  - Head of MarketingCelia Candebat - Senior Marketing ExecutiveChantelle - Account DirectorBusiness Development ManagerMark Weaver - Senior Account ManagerBecky Hesilrige - Social Media and PR ManagerKav - Creative DeveloperPete - Creative DeveloperAdam - Product ManagerLiza BaronMarc Munier - Commercial DirectorLucy - Senior Email Marketing ConsultantAndy Thorpe - Deliverability & Compliance ManagerJade - Account DirectorHannah Ward - Senior Marketing ExecutiveChristian Ryan - Online Marketing Manager

Top of the Blogs

  1. How Zombieland helped solve email background rendering issues
    Think the use of background images in an email is a definite no no? Then think again! In this blog Kav runs through two proven ...
  2. Animation in email - does it serve a purpose?
    Animation in email has always been a bit of a controversial subject - does it work? Doesn't it work? And, most importantly, how does it ...
  3. 4 tips for gaining maximum ROI from email using PPC, SEO & Analytics
    An online marketer's role can be very time consuming so it makes sense to maximise all the tools at your disposal.  In this blog ...

      Take a demo

Categories