Back to all posts
The Complete Guide to Responsive HTML Email Templates
HTML Development

The Complete Guide to Responsive HTML Email Templates

MW
Marcus WebbEmail Engineer
Published
12 min read

Why Responsive Email Is Harder Than Responsive Web

Responsive web design has been standardized for over a decade. Every modern browser supports media queries, flexbox, grid, and the full modern CSS toolkit. You write clean CSS, test in three browsers, and ship. The responsive web paradigm is well-understood.

Responsive email is messier. You're working with a rendering environment that includes clients that ignore media queries entirely (Gmail on Android), clients that process HTML through a word processor (Outlook), and clients that inject their own reset styles that override yours. The modern CSS tools that make responsive web development elegant are either unsupported or unreliable in email.

This guide covers the approaches and techniques that work — tested against the current email client landscape — and explains the tradeoffs between them.

The Three Responsive Email Approaches

Approach 1: Fixed Width (600px)

The simplest approach: design your email at a fixed 600px width and don't try to make it responsive. On mobile, the email client scales the entire email down to fit the screen width, and subscribers can pinch-zoom to read it.

This works for simple, text-heavy emails but fails for anything with small text, touch targets, or images that need to be a specific size on mobile. It's no longer considered best practice but remains appropriate for simple transactional emails where mobile readability isn't critical.

Approach 2: Fluid Layout

Fluid layouts use percentage-based widths instead of fixed pixels. A 50/50 two-column layout uses width: 50% on each column, so they naturally resize as the viewport changes. This produces a somewhat responsive email without requiring media query support.

The limitation: fluid layouts are hard to control at small screen sizes. A 50% width column at 375px viewport is only 187px — too narrow for most content. Fluid layouts work well for simple single or double-column structures but become unwieldy with more complex layouts.

The standard modern approach: design a desktop layout (typically 600px wide) and use CSS media queries to override the layout at mobile breakpoints. Columns collapse from side-by-side to stacked, font sizes increase for readability, and padding is adjusted for touch interaction.

This requires client support for <style> block CSS and media queries — which means it won't work in Gmail on Android or clients that strip <style> blocks. The solution is to ensure your desktop/default layout degrades acceptably in those clients, then use media queries to enhance the experience in clients that support them.

The Hybrid / Spongy Technique

The "spongy" or hybrid technique bridges the gap between fluid and media query approaches. It combines percentage widths with max-width constraints and uses the display: inline-block trick to create columns that collapse gracefully even without media query support.

Here's the structure:

<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td align="center">
      <!--[if mso]>
        <table width="600" cellpadding="0" cellspacing="0" border="0">
        <tr><td width="285">
      <![endif]-->
      <div style="display: inline-block; width: 100%; max-width: 285px; vertical-align: top;">
        <!-- Column 1 content -->
      </div>
      <!--[if mso]></td><td width="285"><![endif]-->
      <div style="display: inline-block; width: 100%; max-width: 285px; vertical-align: top;">
        <!-- Column 2 content -->
      </div>
      <!--[if mso]></td></tr></table><![endif]-->
    </td>
  </tr>
</table>

The display: inline-block columns sit side-by-side when there's enough horizontal space, and naturally stack vertically when the viewport is narrower than their combined max-widths. Outlook uses the conditional comment tables for a fixed layout. Clients without media query support get a reasonable fluid behavior.

Media Query Responsive Patterns

For clients that do support media queries, add this pattern to your <style> block:

@media only screen and (max-width: 600px) {
  .two-col {
    width: 100% !important;
    display: block !important;
    max-width: 100% !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  .email-container {
    width: 100% !important;
  }
  
  h1 {
    font-size: 26px !important;
    line-height: 1.3 !important;
  }
  
  .cta-button {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  td {
    padding: 12px 16px !important;
  }
}

Key patterns:

  • width: 100% !important — Forces columns to full width on mobile
  • display: block !important — Stacks inline-block elements vertically
  • !important throughout — Overrides inlined base styles

Typography for Mobile

Minimum Font Sizes

Body text should be at least 14px, ideally 16px, in mobile email. iOS Mail and some Android clients automatically increase font size below 13px, which can break your layout. Specify 16px for comfortable mobile reading and explicitly set -webkit-text-size-adjust: 100% to prevent automatic size adjustment.

Line Height

Set line-height as a unitless value (e.g., line-height: 1.6) rather than pixels, so it scales proportionally with the font size. Minimum 1.4 for body text, 1.2 for headings.

Heading Hierarchy

A clear heading hierarchy (H1 for the main subject, H2 for section headers) improves scannability on mobile, where subscribers often skim content. Make H1 large and bold (28-32px on desktop, 24px on mobile), H2 clearly secondary (20-22px).

Images in Responsive Email

Make Images Fluid

Add max-width: 100% and height: auto to all images so they scale down on small screens:

<img src="..." width="600" height="300" 
     style="width: 100%; max-width: 600px; height: auto; display: block; border: 0;" 
     alt="Description">

The HTML width and height attributes preserve the aspect ratio when CSS is stripped. The max-width prevents the image from exceeding its natural size on large screens. The inline width: 100% makes it fluid.

Retina Images

On retina displays, 1x images appear blurry. Use 2x images (twice the pixel dimensions of the display size) for hero images, logos, and any imagery where quality is important. A hero image displayed at 600px wide should be 1200px wide at 2x resolution.

Hero Image Alternatives

Use descriptive alt text on all images for when images are blocked. For hero images, consider whether the text content of the email still makes sense without the image — it should. For decorative images, use alt="" to signal to screen readers that the image can be skipped.

Touch Targets for Mobile

Apple's Human Interface Guidelines recommend a minimum tap target size of 44x44 points. For email buttons, this means a minimum height of 44px and enough horizontal padding that the text isn't crammed in a tiny space. On mobile, make CTA buttons full-width (100%) so they're easy to tap with a thumb. Stack multiple CTAs vertically rather than side-by-side.

Testing Responsive Email

Test at multiple breakpoints: 320px (small phones), 375px (standard iPhone), 414px (large phone), and your desktop width (typically 600px). Use Postdrop.io to preview mobile renders across Gmail iOS, Gmail Android, Apple Mail, and Samsung Mail simultaneously.

Pay special attention to Gmail on Android — it's the client most likely to ignore your media queries and render the desktop layout on a small screen. Your desktop layout should be readable at mobile viewport sizes even without the responsive CSS applying. If the desktop layout is a disaster at 375px, your Android Gmail subscribers are having a bad experience regardless of your media query work.

Responsive email is harder than responsive web, but the fundamentals are the same: design for the constraints of the environment, test on real devices and real clients, and iterate until it works well everywhere that matters for your audience.

Stop guessing how your emails will render

Join thousands of developers using Postdrop.io to build, test, and share beautiful HTML emails in record time.

Try Postdrop.io for Free

More on HTML Development