Read Time: 13 min

Understanding Responsive and Hybrid Email Design

Categories

Now that Apple’s Mail Privacy Protection dominates reading environments, it’s increasingly important that email campaigns are designed to accommodate a number of scenarios–including webmail, desktop and mobile.

Designers, looking for more control over their email campaigns, use responsive and hybrid email design to make sure emails look great everywhere.

Read on to understand  what both have to offer, and how they can be used to make your email campaigns better.

What is hybrid email design?

Hybrid is brilliant when you need to support virtually any email client out there. Since everything happens in the body of the email, Gmail and any future clients that strip or ignore media queries won’t be a problem. Plus, you can always include media queries as an enhancement for clients that support them.

Hybrid email gets a bit complicated, though, when you start using it on complex layouts. While there are techniques for dealing with two, three, and four-column layouts, they are harder to implement and more fragile than the corresponding “target-classes-and-override” approach of traditional responsive emails.

What is responsive email design?

Responsive emails use fluid tables and images to make content flow across different screen sizes. How? By using CSS media queries to change fixed-width tables and images on desktops into fluid ones for smaller screens.

A starting point

Let’s say we have a section of an email with an image, headline, and bit of copy. The code looks like this:

<table border="0" cellpadding="0" cellspacing="0" width="100%"> 
    <tr>
        <td bgcolor="#00a9f7" align="center">
            <table border="0" cellpadding="0" cellspacing="0" width="600" class="responsive-table">                
                <tr>
                    <td align="center" valign="top" style="padding: 40px 0px 40px 0px;">
                        <!-- IMAGE -->
                        <img alt="Example" src="http://placehold.it/600x300" width="600" style="display: block;" border="0" class="responsive-image">
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 20px 10px;">
                        <!-- HEADLINE -->
                        <p style="color: #ffffff; font-family: sans-serif; font-size: 24px; font-weight: bold; line-height: 28px; margin: 0;">Announcing Some News</p>
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 60px 10px;">
                        <!-- COPY -->
                        <p style="color: #b5e2f7; font-family: sans-serif; font-size: 16px; font-weight: normal; line-height: 24px; margin: 0;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.</p>
                    </td>
                </tr> 
            </table>
        </td>
    </tr>
</table>

You can see that, while we use a 100% wide container table for full-width background colors, the content is wrapped in a table that is 600 pixels wide. Likewise, the image is 600 pixels wide. On desktop, that section of the email looks like this:

Example of Responsive Email Design on desktop

If we were to view that email on a mobile client, we’d see this:

example of hybrid responsive mobile

The fixed-width table and image are preventing that content from shrinking down to fit on the smaller screen. How can we fix that? How do we make those elements fluid? With a media query in the head of our HTML.

Making it responsive

Media queries allow us to specify how things should be styled under certain circumstances. We feed media queries some conditions and some styles and those styles are applied to our email when those conditions are met. In the case of email and mobile, those conditions are the sizes of the screen.

<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
	@media screen and (max-width: 600px) {
		
	}
</style>
</head>

The max-width: 600px rule is our screen size. In this case, any screens larger than 600px wide will see the fixed-width version of our email. Screens that are smaller than 600 pixels will force the styles in the media query to be rendered, allowing us to override inline styles in our email and optimize the design for smaller screens.

If you look back at our original table, you’ll see that the table has a class attribute of responsive-table applied. Likewise, the image has a class of responsive-image.

In our media query, we can override those fixed widths by targeting those classes and applying the appropriate styles.

@media screen and (max-width: 600px) {
  .responsive-table {
    display: block;
    width: 100% !important;
  }
   
  .responsive-image {
    height: auto;
    max-width: 100% !important;
  }
}

In email clients that support media queries, our email will be fluid and work well on smaller screens.

example showing how an email would respond on a smaller screen

This same technique of targeting classes and overriding styles can be used to change the layout of your email, too. In a two- or three-column layout, you can target the columns and make them 100% wide on mobile to create an easy-to-read, single-column layout. Media queries are also useful for adjusting the size of text, links, and buttons on mobile—increasing or decreasing the size of each to aid in readability and usability.

What are the pros of responsive email?

The main advantage of a responsive email is that the designer has a ton of control over the display of content across devices. Media queries are very powerful and, when used well, allow designers to target and adjust the layout and style of content at a very granular level.

The major drawback is that traditional responsive design isn’t supported everywhere. Most notably, Gmail does not fully support styles in the head of an email, rendering (pun intended) responsive techniques useless in Gmail’s various clients.

Knowing that Gmail creates problems for responsive emails, what can a designer do? Let’s take a look at the hybrid—or spongy—coding approach.

What is hybrid/spongy coding?

The hybrid coding approach, sometimes called spongy coding, is a direct reaction to clients like Gmail ignoring media queries. Pioneered by MailChimp’s Fabio Carneiro, and popularized by the likes of Mike Ragan and Nicole Merlin, it follows some of the same principles as traditional responsive design but implements them in a unique way.

Hybrid coding still uses fluid tables and images but, in contrast to responsive emails, those tables and images are fluid by default. Instead of using media queries to trigger those fluid states on smaller screens, hybrid coding favors Microsoft conditional comments to restrain fluid tables on larger screens. Sound confusing? It’s not as bad as it seems.

While there are variations to the approach, hybrid emails work on the following principles:

  1. Fluid tables and elements by default
  2. Max-width CSS to constrain widths on desktop
  3. MSO conditional comments to constrain widths in Outlook

The basics

Using the same layout as before, let’s look at the code behind a hybrid table:

<table border="0" cellpadding="0" cellspacing="0" width="100%"> 
    <tr>
        <td bgcolor="#00a9f7" align="center">
            <table border="0" cellpadding="0" cellspacing="0" width="100%">                
                <tr>
                    <td align="center" valign="top" style="padding: 40px 0px 40px 0px;">
                        <!-- IMAGE -->
                        <img alt="Example" src="http://placehold.it/600x300" width="600" style="display: block; width: 100%;" border="0">
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 20px 10px;">
                        <!-- HEADLINE -->
                        <p style="color: #ffffff; font-family: sans-serif; font-size: 24px; font-weight: bold; line-height: 28px; margin: 0;">Announcing Some News</p>
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 60px 10px;">
                        <!-- COPY -->
                        <p style="color: #b5e2f7; font-family: sans-serif; font-size: 16px; font-weight: normal; line-height: 24px; margin: 0;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.</p>
                    </td>
                </tr> 
            </table>
        </td>
    </tr>
</table>

You can see here that we use an identical structure. The only difference is that, instead of using fixed pixel values for the width of both the table and image, we are using fluid percentage values. This allows the content of the email to flow to fill different screen sizes.

If we were to leave it at this, though, our subscribers would see obnoxiously wide emails on desktop. To prevent that from happening, we can add the CSS max-width property to both the table and image.

<table border="0" cellpadding="0" cellspacing="0" width="100%"> 
    <tr>
        <td bgcolor="#00a9f7" align="center">
            <table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;" >                
                <tr>
                    <td align="center" valign="top" style="padding: 40px 0px 40px 0px;">
                        <!-- IMAGE -->
                        <img alt="Example" src="http://placehold.it/600x300" width="600" style="display: block; width: 100%; max-width: 100%;" border="0">
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 20px 10px;">
                        <!-- HEADLINE -->
                        <p style="color: #ffffff; font-family: sans-serif; font-size: 24px; font-weight: bold; line-height: 28px; margin: 0;">Announcing Some News</p>
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 60px 10px;">
                        <!-- COPY -->
                        <p style="color: #b5e2f7; font-family: sans-serif; font-size: 16px; font-weight: normal; line-height: 24px; margin: 0;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.</p>
                    </td>
                </tr> 
            </table>
        </td>
    </tr>
</table>

In most cases, this works to keep widths at bay. However, Microsoft Outlook doesn’t currently respect the max-width property. To account for this, it’s necessary to use conditional comments to make hidden, fixed-width ghost tables that only Outlook sees. Those look like this:

<table border="0" cellpadding="0" cellspacing="0" width="100%"> 
    <tr>
        <td bgcolor="#00a9f7" align="center">
            <!--[if (gte mso 9)|(IE)]>
            <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
            <tr>
            <td align="center" valign="top" width="600">
            <![endif]-->
            <table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;" >                
                <tr>
                    <td align="center" valign="top" style="padding: 40px 0px 40px 0px;">
                        <!-- IMAGE -->
                        <img alt="Example" src="http://placehold.it/600x300" width="600" style="display: block; width: 100%; max-width: 100%;" border="0">
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 20px 10px;">
                        <!-- HEADLINE -->
                        <p style="color: #ffffff; font-family: sans-serif; font-size: 24px; font-weight: bold; line-height: 28px; margin: 0;">Announcing Some News</p>
                    </td>
                </tr>
                <tr>
                    <td align="center" valign="top" style="padding: 0px 10px 60px 10px;">
                        <!-- COPY -->
                        <p style="color: #b5e2f7; font-family: sans-serif; font-size: 16px; font-weight: normal; line-height: 24px; margin: 0;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.</p>
                    </td>
                </tr> 
            </table>
            <!--[if (gte mso 9)|(IE)]>
            </td>
            </tr>
            </table>
            <![endif]-->
        </td>
    </tr>
</table>

That bit of code is essentially telling both newer (mso) and older (IE) versions of Outlook to wrap our content in the fixed-width table contained within that comment.

Since all of those elements are fluid by default, our email works very well on nearly every smaller screen. And, since it doesn’t rely on media queries to trigger those responsive styles, it works in problematic clients like Gmail, too.

It should be noted that this is a very basic breakdown of how hybrid coding works. There are a few variations on the principles outlined above which are outside the scope of this article.

Should you use hybrid email or responsive?

As we’ve seen, both traditional responsive and hybrid email design have pros and cons. When deciding on which one you should use, you should ask yourself these three questions:

  1. Do I need to support Gmail?
  2. How complex is my layout?
  3. How comfortable am I with complex code?

It definitely takes some practice and experimentation to become proficient at developing robust hybrid emails. If you don’t have the knowledge, or time to invest in learning hybrid coding, traditional responsive might be for you. Likewise, if you have a complex design, implementing it in fluid, Outlook conditional-wrapped tables might be out of the question.

If, after reviewing where your subscribers open, you need to support clients like the Gmail app or Inbox—or want to make your campaigns ready for future email client updates—then hybrid coding is likely the best approach to use. While complex layouts can get confusing, and fewer designers and developers are familiar with hybrid coding, the time investment in learning and testing the approach will pay off in the long run.

Need a starting point?

Short of time or resources to build your own responsive or hybrid templates? The Litmus Community includes modern, high-quality templates that are free to download and use.

Each template comes with a responsive, hybrid, and mobile-aware version and can be used out-of-the-box in both Campaign Monitor and MailChimp. You can also download the plain HTML or export it directly to Litmus Builder to customize for the ESP of your choice.

Explore our free templates →

This article originally published on April 21, 2016. It was updated on August 31, 2022.