Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can all the CSS for HTML emails css go in the head?

I am using one of the MailChimp templates as a base for an email design, however I will not be using MailChimp to send the email.

The MailChimp template has around 330 lines of CSS in the head. Its beens a while since I last did HTML emails, but is this acceptable or do I have to use inline styles on the elements?

I wasn't sure if MailChimp had a script that turned all the styles into inline css, and if I had to do the same thing.

like image 668
Craig Ward Avatar asked Aug 23 '12 10:08

Craig Ward


4 Answers

inline CSS is the most preferred for email templates, because not all email clients support CSS in head section

Here is Guide to CSS support in email

like image 120
Dipak Avatar answered Oct 20 '22 00:10

Dipak


Gmail is now rolling out support for media queries and styles in the head. Using Campaign Monitor's Guide, all the major clients now support styles in the head. If you're wanting the broadest possible support it's probably safer to keep inlining styles, but if your users are all using the major clients it's now safe to start pulling the styles out.

like image 22
Matthew Johnson Avatar answered Oct 20 '22 02:10

Matthew Johnson


Inline Styles is the way go to achieve a consistent look and feel across all email clients.

Also have a look at: http://coding.smashingmagazine.com/2012/03/13/techniques-overcome-poor-css-support-email/

like image 44
Ryan McDonough Avatar answered Oct 20 '22 01:10

Ryan McDonough


Here is a great tool for taking an HTML-email document with styles in the header and moving them inline. Should save you a lot of time and effort.

http://premailer.dialect.ca/

like image 2
Jon Smith Avatar answered Oct 20 '22 02:10

Jon Smith