Skip to content

ONE/Northwest

Sections
New tools and strategies for engaging people in protecting the environment
You are here: Home Articles, Ideas and Advice Guidelines For Using CSS In Email Newsletters

Guidelines For Using CSS In Email Newsletters

This article will explain the pitfalls to avoid and the methods to employ in order to get email newsletters to display consistently across many email clients.

Email newsletters are more popular than ever, and everyone loves to design a rich website-like newsletter for their subscribers. Unfortunately, email isn't the web.   Your beautiful design work might look great in one email program, but chances are when you look at the same work a different email program the results will not be the same.

Why? In a nutshell, some email clients are moving away from full CSS support.   CSS (Cascading Style Sheets) is the technology that allows for modern, powerful, flexible website designs.  (If you don't know what CSS is or how to use it, chances are the rest of this article isn't for you -- but show it to your email newsletter designer!)

As of early 2007, Gmail is the most restrictive as it will ignore all external and embedded style sheets. (It will support inline styles.)  Worse, Microsoft's just-released Outlook 2007 actually takes a few big steps backwards in its CSS support.  (Check out Campaign Monitor's article for the shocking lowdown!)  For this reason, we consider compatability with Gmail to be the baseline CSS support to design to. If it looks great in Gmail, chances are, it will look great in most other clients.

Even with inline styles, there are some restrictions. Fortunately, deprecated tag attributes will fill the role of certain disabled inline styles.

So here are ONE/Northwest's guidelines for creating successful email newsletters that will look good even in the worst email clients. We don't mention much about design aesthetics, just coding practices that will succeed in all environments. (For testing, we used Gmail, Outlook 2003, Outlook Web Access, Hotmail, and Yahoo).

Things To Avoid

  1. Do not rely on external (<link rel="stylesheet">) or embedded style sheets (those contained within the <style> tag above the <body> tag). This is the most important thing to avoid. Many email services cut everything above the body tag and disable external style sheets.

  2. Don't use javascript in an email newsletter. Ever. There's no better way to have your newsletter marked as spam.

  3. Don't use the <body> or <html> tag. Most email services will ignore them. You can try putting your whole newsletter inside a <div> and apply inline styles to it. Results may vary.

Things To Do

  1. Use tables for layout. Lots of them. You're welcome to try <div> tags for positioning and layout, but our research shows that tables are more consistently supported. C'mon now. Get over your table-phobia.  But do very simple layouts, avoiding lots of nested tables.  Not only will this make your layouts easier to use, you'll avoid problems with background colors (see point #3 below).

  2. Use inline styles liberally in tables. In fact, you'll find you can get the best mileage out of inline styles in <td> tags. That way you are setting up little style regions within each table. Think of these inline styles as miniature style sheets. This allows non-technical users to swap content in and out of pre-formatted cells in a modular fashion.

  3. Avoid background colors in table cells that contain other tables.  The background colors will disappear in Outlook 2007.  Avoid background images entirely.

  4. Test your newsletter by sending to yourself or colleagues. This will give you the chance to catch any problems before your whole subscriber list does!

Images

  1. Define background images using background= instead of the inline background-image call. Gmail, among others, will ignore any url() attribute in an inline style. Keep in mind, though that if the background image is ignored, the default color is going to be white.  That means your white text on black backgrounds will disappear! Don't do it! Stick with text colors that are visible against a white background.

  2. Don’t use images for important content like calls to action, headlines and links to your web site. Outlook, Gmail and others turn images off until allowed by the user. If your entire newsletter is graphical, all your recipients are going to see is a lot of broken images.

  3. Provide alt text for all images.

  4. Declare BOTH height AND width parameters for images. Poor old Outlook Web Access especially needs this for your table layout to display properly.


External sources:

An awesome article by Xavier Frenette which lines out exactly which properties, tags, and selectors are or are not supported by various email clients.

A similar article by David Greiner which includes information about Macintosh.

Campaign Monitor's rundown on CSS support in Outlook 2007



Document Actions

Outlook 2007

Posted by Jannik at May 08, 2007 01:49 PM
It's nice that you think in terms of usability when you advise users to use the ALT tag in images. Problem is that OL 2007 doesn't support that tag anymore, and will strip it out of the mail. Not only is that a huge step backwards for the designers who've depended on being able to get a message across to the end user even if images were turned off, but it's also a major step backwards for usability. Vision impaired people apparently don't need emails.

CSS in Emails

Posted by David Martinez at Jul 09, 2007 09:34 AM
Thanks for the tip on styling the TD tag, that's a create idea. I have recently been using tables with inline styles with much success. The TD tag styling will save me from individually styling each paragraph tag!

Thanks,
David Martinez
http://seidon.com (blog)
http://futurefront.com (business)

Software developers

Posted by Marthinus at Apr 10, 2008 07:43 AM
I would really like to know who the people are that design and test these clients. Is there any logic to this or not? Why the lack of standards or consistency? Do these guys at Microsoft actually use their own software? Is it ever tested? I makes absolutely no sense and in the absence of one of them explaining themselves I must conclude that they are all morons.

powered by Plone | site by ONE/Northwest and served with clean energy