Skip to main content
Act-On Software

Creating a Custom Look and Feel for an Email Message

AUDIENCE: 
OBJECTIVES:

For a custom look and feel, you can build a template from scratch, upload a template that’s been created for use with Act-On, or base a new template on an existing template or message in your account. You can also build stationery from scratch or download stationery that’s close to what you want, modify it, and upload it to Act-On for use in your account.

Act-On provides templates for several common message types and many choices for stationery, all of which include the logo and signature you’ve set up for your account.

Although creating a stationery seems as simple as creating an html file with three special fields in it (((header)),((text)),((footer)), creating HTML for email is a much more interesting problem.

There are some uncomfortable facts that those new to designing HTML email should be aware of. Building an email is not like building for the web. While web browsers continue to improve their compiance with standards, many email clients have not. Some have even gone backwards. In 2007, Microsoft switched the Outlook rendering engine from Internet Explorer to Word. Add to this the quirks of the major web-based email clients like Gmail and Hotmail, sprinkle in a little Lotus Notes and you’ll soon realize how different the email game is.

While it’s not without its challenges, rest assured creating html for e-mail can be done. The key is to focus on three things. First, you should keep it simple. The more complex your email design, the more likely is it to fail on one of the popular clients with poor standards support. Second, you need to take your coding skills to 1998. That often means nesting tables, bringing CSS inline and following some simple coding guideline. Finally, you need to test your designs regularly. Just because a template looks nice in Hotmail today, doesn’t mean it will next week.

To maintain your sanity, it’s a good idea to decide exactly which email clients you plan on supporting when building a HTML email. While general research is helpful, the email clients your subscribers are using can vary significantly from list to list. If you know none of your recipients are using a client like Lotus Notes, save yourself some frustration and ignore it altogether.

Knowing which email clients you’re targeting not only makes the building process easier, it can save you a lot of time in the testing phase too. Just remember that pixel perfection in all email clients is a pipe dream. It is strongly recommended use of a service like Litmus.com or emailonacid.com.

Design Considerations

Because clients like Gmail and Outlook 2007 have poor support for float, margin and padding, you’ll need to use tables as the framework of your email. While nested tables are widely supported, consistent treatment of width, margin and padding within table cells is not. For the best results, keep the following in mind when coding your table structure.

When you combine table widths, td widths, td padding and CSS padding into an email, the final result is different in almost every email client. The most reliable way to set the width of your table is to set a width for each cell, not for the table itself.

<table cellspacing="0" cellpadding="10" border="0"><tr><td width="80"></td><td
width="280"></td></tr></table>

Never assume that if you don’t specify a cell width the email client will figure it out. It won’t. Also avoid using percentage based widths. Clients like Outlook 2007 don’t respect them, especially for nested tables. Stick to pixels. If you want to add padding to each cell, use either the cell padding attribute of the table or CSS padding for each cell, but never combine the two.

Table nesting is far more reliable than setting left and right margins or padding for table cells. If you can achieve the same effect by table nesting, that will always give you the best result across the buggier email clients.

 Many email clients ignore background colors specified in your CSS or the <body> tag. To work around this, wrap your entire email with a 100% width table and give that a background color.

<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td
bgcolor=”#000000”>Your email code goes here.</td></tr></table>

You can use the same approach for background images too. Just remember that some email clients don’t support them, so always provide a fallback color.

Avoid unnecessary whitespace in table cells 

Where possible, avoid whitespace between your tags. Some email clients can add additional padding above or below the cell contents, breaking your design for no apparent reason.

While some email designers do their best to avoid CSS altogether and rely on the tag, the truth is many CSS properties are well supported by most email clients.

Some web clients strip CSS from the and of any email, so we’re left with no choice but to move all CSS inline.

A number of email clients reject CSS shorthand for the font property. For example, avoid setting your font styles like this:

p { font:bold 1em/1.2em georgia,times,serif;}

Instead, declare the properties individually like this:


p { font-weight: bold; font-size: 1em; line-height: 1.2em; font-family: georgia,times,serif;}

Support for @font-face across the major email clients is very poor. It’s much better to use web-safe fonts in email. When declaring the color property in your CSS, some email clients don’t support shorthand hexadecimal colors like color:#f60; instead of color:#ff6600;. Stick to the longhand approach for the best results.

Just like table cell spacing, paragraph spacing can be tricky to get a consistent result across the board. The best approach is to set the margin inline via CSS for every paragraph in your email, like so:

<p style="margin: 0 1 1.6em 0;">

Links

Some email clients will overwrite your link colors with their defaults, and you can avoid this by taking two steps. First, set a default color for each link inline like so:

<a href="http://somesite.com/" style="color:#ff00ff">this is a link</a> 

Next, add a redundant span inside the a tag.

<a href="http://somesite.com/" style="color:#ff00ff"><span style="color:#ff00ff">this is a 
link</span></a> 

To some this may be overkill, but if link color is important to your design then a superfluous span is the best way to achieve consistency.

Images in HTML emails

The most important thing to remember about images in email is that they won’t be visible by default for many recipients. If you start your design with that assumption, it forces you to keep things simple and ensure no important content is suppressed by image blocking. With this in mind, here are the essentials to remember when using images in HTML email:

Avoid spacer images

While the combination of spacer images and nested tables was popular on the web ten years ago, image blocking in many email clients has ruled it out as a reliable technique today. Most clients replace images with an empty placeholder in the same dimensions, others strip the image altogether. Given image blocking is on by default in most email clients, this can lead to a poor first impression for many of your subscribers. Stick to fixed cell widths to keep your formatting in place with or without images.

Always include the dimensions of your image 

If you forget to set the dimensions for each image, a number of clients will invent their own sizes when images are blocked and break your layout. Also, ensure that any images are correctly sized before adding them to your email. Some email clients will ignore the dimensions specified in code and rely on the true dimensions of your image.

Lotus Notes 6 and 7 don’t support 8-bit or 24-bit PNG images, so stick with the GIF or JPG formats for all images, even if it means some additional file size.

Outlook 2007 has no support for background images (aside from this hack to get full page background images working). If you want to use a background image in your design, always provide a background color the email client can fall back on. This solves both the image blocking and Outlook 2007 problem simultaneously.

Lack of standards support means email clients have long destroyed the chances of a semantic and accessible HTML email. Even still, providing alt text is important from an image blocking perspective. Even with images suppressed by default, many email clients will display the provided alt text instead. Just remember that some email clients like Outlook 2007, Hotmail and Apple Mail don’t support alt text at all when images are blocked.

Use the display hack for Hotmail

For some inexplicable reason, Windows Live Hotmail adds a few pixels of additional padding below images. A workaround is to set the display property like so.


img {display:block;}

This removes the padding in Hotmail and still gives you the predictable result in other email clients.

Both Outlook 2007 and earlier versions of Notes offer no support for the float property. Instead, use the align attribute of the img tag to float images in your email.

<img src="image.jpg" align="right"> 

What about mobile email? 

The mobile email landscape was a huge mess until recently. With the advent of the iPhone, Android and big improvements from Palm and RIM, it’s becoming less important to think of mobileas a different email platform altogether. That said, there are a few key pointers to keep in mind when coding your emails to get a decent result for your more mobile subscribers. Keep the width less than 600 pixels.

Because of email client preview panes, this rule was important long before mobile email clients came of age. In truth, the iPhone and Pre have a viewport of 320 pixels, the Droid 480 pixels and the Blackberry models hover around 360 pixels. Sticking to a maximum of 600 pixels wide ensures your design should still be readable when scaled down for each device. This width also gives good results in desktop and web-based preview panes.

In what is almost always a good feature, email clients using webkit (such as the iPhone, Pre and Android) can automatically adjust font sizes to increase readability. If testing shows this feature is doing more harm than good to your design, you can always disable it with the following CSS rule:

-webkit-text-size-adjust: none;

Don’t forget to test 

While standards support in email clients hasn’t made much progress in the last few years, there has been continual change (for better or worse) in some email clients. For this reason alone it’s important to retest your email designs on a regular basis.

  • Was this article helpful?