Skip to main content
Emailens
Blog

Email Rendering Bugs: The Developer's Field Guide to Why Emails Break

Emails break because each client renders HTML with a different engine: Outlook Classic uses Word, Gmail runs a sanitizer in front of the browser and Apple Mail uses WebKit, so the same markup needs a fallback for each.

The checker needs a computer screen.

A free account opens all 21 clients and keeps your checks for 7 days. Create a free account →

Philippe Kam, founder of Emailens · Published 6 Oct 2026 · Updated 20 Oct 2026

@emailens/engine 0.16.1 · data last changed 17 Oct 2026

Every developer remembers the first time an email they coded looked stunning in Chrome, only to arrive in a client's inbox looking like an unstyled 1996 web page. Text blowouts, stripped background images, clipped footers, and inverted dark mode logos are not random glitches. They are the deterministic consequences of 4 fundamentally incompatible rendering engines. Here is a field guide to diagnosing, understanding, and fixing the most infamous email rendering bugs.

1. The Root Cause: The 4 Incompatible Email Engines

Web developers build with the assumption of web standards: CSS Flexbox, CSS Grid, media queries, CSS variables, and relative units work identically in Chrome, Safari, and Firefox. In email, web standards do not exist.

When an email is opened, it passes through one of four major layout engines, each with its own rendering model and security sanitizer:

EngineDominant ClientsLayout ModelBiggest Pitfall
Microsoft Word (MSO)Outlook 2016-2024, 365 WindowsPrint document paginationIgnores max-width, flexbox, background-image
Google Blink + SanitizerGmail Web, Gmail iOS, AndroidScoped Web DOM102KB clipping, drops a style block over 16KB or with a syntax error
Apple WebKitApple Mail macOS, iOS MailModern browser engineData detectors, viewport zoom wiggles
Chromium / GeckoNew Outlook, Thunderbird, YahooModern web engineWebmail class isolation & dark mode shifts

Because an email campaign must render legibly across all four engines simultaneously, developers cannot write modern CSS in isolation. Every modern layout enhancement requires a defensive fallback.

2. The Top Outlook Desktop (Word Engine) Bugs

Classic Outlook on Windows accounts for over 70% of enterprise B2B email volume, and it is responsible for 90% of layout destruction. Here are the most critical bugs caused by Microsoft Word:

Bug 1: Horizontal Column Blowout (max-width Ignored)

Symptom: A 600px centered newsletter expands to the entire width of a 34-inch ultrawide monitor, or two 300px columns refuse to sit side-by-side and stack awkwardly.

Root Cause: Word has no concept of CSS max-width, min-width, or display: flex. It treats divs as unconstrained block containers.

The Fix: Wrap the responsive container in an MSO ghost table (<!--[if mso]><table width="600">...<![endif]-->). This enforces rigid physical boundaries in Word while allowing modern mobile clients to scale fluidly.

Bug 2: Background Images Disappear Completely

Symptom: Hero banners render with missing photography, leaving white text on an empty background.

Root Cause: Word strips both CSS background-image and HTML background="..." attributes.

The Fix: Implement Vector Markup Language (VML) <v:rect> and <v:fill> containers. Word interprets VML as native vector graphics, projecting the bitmap behind overlay typography.

Bug 3: 1px Hairline Cracks on High-DPI Windows Displays

Symptom: Thin, white or transparent horizontal lines slice through sliced hero images or table cells on Surface tablets and high-resolution laptops.

Root Cause: When Windows runs at 125% (120 DPI) or 150% (144 DPI) display scaling, Word recalculates table borders and cell widths with fractional sub-pixels, causing rounding errors that reveal background gaps.

The Fix: Declare <o:PixelsPerInch>96</o:PixelsPerInch> in the <head>, enforce border-collapse: collapse; and ensure table cells do not use odd-numbered fractional heights.

Bug 4: The VML Shape Nesting Blast Radius

Symptom: A hero background vanishes, and CTA buttons further down the email render as blank colored rectangles without text.

Root Cause: Placing a VML rounded button (<v:roundrect>) inside a VML background (<v:rect>) corrupts Word's rendering tree. Outlook drops the container fill completely and suppresses text drawing for all subsequent VML shapes across the document.

The Fix: Never nest VML shapes. Use table-cell buttons with CSS border-radius inside hero banners instead of VML shapes.

Bug 5: The First-Class-Only Selector Quirk

Symptom: Stacking utility classes (e.g. class="btn primary") causes secondary styles to be silently ignored in desktop Outlook.

Root Cause: Classic Outlook's Word parser evaluates only the first class name on an element when styles conflict. Properties defined on subsequent classes are discarded.

The Fix: Avoid chaining utility classes on the same element. Merge conflicting declarations into a single class (e.g. .btn-primary) or inline the critical declarations.

Bug 6: The Double-Brace Stylesheet Drop in Outlook.com

Symptom: The entire second half of your email loses styling exclusively in Outlook.com and Outlook iOS/Android.

Root Cause: Minified CSS ending with two adjacent closing curly braces (}}), such as a rule closing inside a media query, breaks Outlook.com's CSS preprocessor. It discards every single style rule following the double brace.

The Fix: Ensure your minifier preserves a space or newline between adjacent closing braces (} }).

outlook-defensive-fixes.html
42 lines
<!-- Outlook Bug 1 Fix: Ghost Table for max-width and column stacking -->
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
      <!--[if mso]>
      <table role="presentation" width="600" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>
      <![endif]-->
      <div style="max-width: 600px; margin: 0 auto;">
        <!-- Email content here -->
      </div>
      <!--[if mso]>
          </td>
        </tr>
      </table>
      <![endif]-->
    </td>
  </tr>
</table>

<!-- Outlook Bug 2 Fix: High-DPI 120/144 DPI scaling fix in <head> -->
<!--[if mso]>
<xml>
  <o:OfficeDocumentSettings>
    <o:AllowPNG/>
    <o:PixelsPerInch>96</o:PixelsPerInch>
  </o:OfficeDocumentSettings>
</xml>
<![endif]-->

<!-- Outlook Bug 3 Fix: Exact line-height rule to prevent font clipping -->
<p style="margin: 0; font-size: 16px; line-height: 24px; mso-line-height-rule: exactly;">
  Crisp typography without Word clipping or excessive line gaps.
</p>

<!-- Outlook Bug 4 Fix: Avoid class stacking conflicts (Word evaluates first class only) -->
<!-- ❌ class="btn primary" -> Word ignores conflicting properties in .primary -->
<!-- ✅ Merge into a single class: -->
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="btn-primary">
  <tr><td>CTA</td></tr>
</table>

3. The Top Gmail Rendering Bugs

Gmail is the world's most popular consumer email client, but its rendering engine enforces harsh security and performance sanitizations that catch developers off guard:

Bug 1: The 102KB Silent Message Clipping

Symptom: Footers vanish, legal disclaimers and unsubscribe links disappear, and email open rates drop sharply.

Root Cause: If the raw HTML payload exceeds 102KB (104,448 bytes), Gmail cuts off the email and inserts “[Message clipped] View entire message.” Because tracking pixels sit at the bottom of the body HTML, clipping destroys deliverability telemetry.

The Fix: Strip redundant inline CSS, eliminate inline base64 images, and test HTML payload size with our Gmail clipping guide and Email Size Checker.

Bug 2: The 16 KB Cumulative <style> Ceiling

Symptom: Media queries, mobile responsiveness, or custom classes defined later in your stylesheet fail to render in Gmail, even though the email is well under the 102KB clipping limit.

Root Cause: Gmail calculates the cumulative byte size of all <style> blocks. Once total CSS exceeds 16 KB (16,384 bytes), Gmail silently discards all remaining CSS declarations across the document without raising an error.

The Fix: Keep embedded head styles strictly under 16KB. Purge unused utility classes, eliminate verbose CSS comments, and inline core structural layouts.

Bug 3: Space-Separated Color Syntax Stripping

Symptom: An entire <style> tag vanishes, or an element loses all inline styles including padding, borders, and typography.

Root Cause: Modern CSS allows space-separated color arguments (e.g. rgb(30 41 59) or hsl(210 50% 20%)). When Gmail's parser encounters a space-separated color in a <style> block, it deletes the entire block. When used in an inline style attribute, Gmail drops every single declaration on that element, not just the color.

The Fix: Always use traditional comma-separated syntax: rgb(30, 41, 59) and rgba(30, 41, 59, 0.8).

Bug 4: The Nuclear <style> Block Drop

Symptom: The entire email loses all custom styling in Gmail, reverting to browser-default serif typography and unstyled tables.

Root Cause: Gmail parses the <style> tag in the <head> with an all-or-nothing validator. If it encounters a single unsupported CSS selector (e.g. :has(), CSS custom properties, or an unclosed curly bracket), it deletes the entire style block.

The Fix: Always inline your core styles directly onto HTML tags, and sanitize embedded CSS with an AST linter.

Bug 5: Mobile Font Boosting (Unwanted Text Resizing)

Symptom: Fine print, copyright notices, or subheaders appear larger than headline text on mobile devices.

Root Cause: On mobile screens, WebKit and Blink heuristically “boost” font sizes below 13px to improve readability if they detect multi-column table layouts.

The Fix: Add -webkit-text-size-adjust: 100%; and -ms-text-size-adjust: 100%; to the <body> tag, and avoid font sizes under 12px.

Bug 6: Blue Link Hijacking

Symptom: Dates, addresses, and phone numbers turn into bright royal blue text with underlines, breaking your brand palette.

Root Cause: Gmail scans text nodes for entities like “October 15” or “555-0199” and automatically wraps them in anchor tags.

The Fix: Wrap dates and phone numbers in anchor tags with explicit inline color: inherit; text-decoration: none;, or insert a zero-width non-joiner (&zwnj;) between digits.

gmail-defensive-fixes.html
22 lines
<!-- Gmail Bug 1 Fix: Always use comma-separated colors (not modern space syntax) -->
<!-- ❌ rgb(30 41 59) causes Gmail to drop the entire <style> block or inline declarations -->
<!-- ✅ Write with commas: -->
<p style="color: rgb(30, 41, 59); background-color: rgba(241, 245, 249, 0.8);">
  Safe colors across Gmail web and mobile apps.
</p>

<!-- Gmail Bug 2 Fix: Prevent blue auto-linking on dates and numbers -->
<a href="#" style="color: inherit; text-decoration: none; cursor: default; pointer-events: none;">
  October 15, 2026
</a>

<!-- Gmail Bug 3 Fix: Prevent Mobile Font Boosting on small utility text -->
<p style="font-size: 11px; line-height: 16px; margin: 0; -webkit-text-size-adjust: none;">
  Unsubscribe or update preferences.
</p>

<!-- Gmail Bug 4: Respect the 16KB cumulative <style> ceiling -->
<!-- Keep head CSS under 16,384 bytes, and inline core structural styles -->
<td style="padding: 24px; font-family: Arial, sans-serif; font-size: 15px; color: #334155;">
  Inlined core styles survive Gmail's 16KB style tag truncation.
</td>

4. The Top Apple Mail & WebKit Quirks

Apple Mail (macOS and iOS) has the best modern CSS engine in email, supporting Grid, Flexbox, and CSS animations. However, mobile iOS Mail introduces subtle UX bugs:

  • Horizontal Viewport Wiggle: If a single nested table cell or image exceeds the screen width by even 1px, iOS Mail zooms out the entire email or allows horizontal panning. Always set width: 100%; max-width: 100%; on images and meta name="viewport" content="width=device-width, initial-scale=1".
  • Image Aspect Ratio Squishing: When providing an HTML attribute width="300" alongside inline CSS height: auto;, older WebKit builds can squish or distort the image before the external asset finishes loading. Always declare matching intrinsic aspect ratios or explicit height limits.
  • Apple Data Detectors: Similar to Gmail, iOS automatically underlines dates, flights, and calendar items. Neutralize this with the CSS rule: x-apple-data-detectors { color: inherit !important; text-decoration: none !important; }

5. Dark Mode Rendering Inconsistencies & Disappearing Logos

Dark mode is not a single standard across email clients. It splits into three completely different operational models:

Dark Mode ModelClientsBehavior
No Inversion (CSS Controlled)Apple Mail macOS, iOS MailHonors @media (prefers-color-scheme: dark) without altering your HTML colors automatically.
Partial InversionOutlook Web, Outlook App iOSDetects light backgrounds and turns them dark, but retains dark backgrounds untouched.
Full Forced InversionGmail Android, Outlook Windows 365Inverts all colors indiscriminately, turning dark palettes light and light palettes dark.

The most disastrous dark mode bug is the Disappearing Dark Logo. When a transparent PNG logo with black typography sits over a white background, full inversion clients turn the background black, leaving the black logo completely invisible.

dark-mode-logo-fix.html
19 lines
<!-- Dark Mode Bug Fix: Protecting dark logos against forced inversion -->
<!-- 1. Add a subtle 1px translucent stroke or light drop-shadow around black marks -->
<img
  src="https://example.com/logo-dark-mark.png"
  alt="Company Logo"
  width="140"
  height="40"
  style="display: block; border: 0; filter: drop-shadow(0px 0px 1px rgba(255,255,255,0.8));"
/>

<!-- 2. Dual-logo technique: show light logo in dark mode, dark logo in light mode -->
<div class="light-logo">
  <img src="https://example.com/logo-black.png" width="140" alt="Logo" style="display: block;" />
</div>
<!--[if !mso]><!-->
<div class="dark-logo" style="display: none; max-height: 0; overflow: hidden; mso-hide: all;">
  <img src="https://example.com/logo-white.png" width="140" alt="Logo" style="display: block;" />
</div>
<!--<![endif]-->

For complete implementation details on dark mode targeting, see our Complete Dark Mode Email Guide.

6. Modern Framework Gotchas (React Email, Tailwind, MJML)

Component-based email frameworks like React Email, JSX Email, and MJML compile high-level abstractions into table-based HTML. While they eliminate much of the manual boilerplate, they introduce framework-specific bugs:

  • React Email withMargin Outlook Gaps: Using withMargin on React Email components injects inline margins. Outlook treats margin as padding and bleeds background colors into the gap (see our deep dive on React Email & JSX Email troubleshooting).
  • Tailwind CSS v4 Inline Resolution: Modern Tailwind v4 features like CSS color-mix and subgrid are stripped by email inliners or rejected by Gmail's sanitizer (covered in our Tailwind v4 in Gmail guide).
  • MJML Ghost Table Imbalance: Hand-editing compiled MJML templates often deletes the closing half of an MSO conditional table, causing Outlook to swallow the rest of the layout.

7. Automated Bug Prevention & Testing Checklist

The traditional workflow for catching email rendering bugs was slow and expensive: send test emails to 10 physical devices or pay for cloud screenshot pools that take minutes to render.

The modern approach uses static AST analysis combined with real rendering engines. For an exhaustive step-by-step walkthrough of automated QA pipelines and CI/CD testing, consult our HTML Email Testing Guide. Before launching any campaign, run through this preventative checklist:

Validate CSS Support: Check every inline property against the Emailens CSS Compatibility Checker to catch unsupported properties before sending.
Enforce 102KB Limit: Validate that your final compiled HTML payload is well under 100KB using the Email Size Checker to prevent Gmail clipping.
Generate Bulletproof Outlook Fallbacks: Use the Outlook VML Background Generator and Ghost Table Generator to produce tested, Word-safe markup.
Audit Dark Mode Inversion: Preview your graphics against simulated Android and Outlook dark mode in the Dark Mode Simulator.

Questions

Why do HTML emails render differently across email clients?

Unlike modern web browsers that share standardized rendering engines (Blink, WebKit, Gecko), email clients use completely different, non-standard layout engines. Classic Outlook on Windows uses the Microsoft Word print rendering engine, Gmail applies an aggressive sanitization pass that strips modern CSS and clips emails at 102KB, while Apple Mail runs on WebKit. A design that looks perfect in a browser preview breaks when subjected to Word's lack of flexbox or Gmail's style-stripping rules.

What is the single most common email rendering bug in Outlook?

Horizontal layout blowout caused by Outlook ignoring max-width and CSS flexbox. Because Classic Outlook relies on the Word engine, it expands multi-column divs to 100% width, stacking columns incorrectly or stretching them across the entire monitor. Email developers fix this using MSO ghost tables (conditional HTML tables visible only to Outlook) paired with inline-block column wrappers.

How does Gmail's 102KB clipping rule affect email rendering?

If the raw HTML file size of an email exceeds 102KB (104,448 bytes), Gmail truncates the message and displays a '[Message clipped] View entire message' link. This breaks the email layout by cutting off footer content, hiding legal unsubscribe links, and severing the open-rate tracking pixel that usually sits at the bottom of the body HTML.

Can I use CSS Flexbox or CSS Grid in HTML email?

Apple Mail and most modern clients support both, but display:flex is not supported in Outlook Classic. display:grid is not supported in Outlook Classic. In Gmail the display value is accepted and the layout property is not: display:grid works in Gmail. grid-template-columns is not supported in Gmail. Production emails need hybrid table layouts or MSO ghost tables as the fallback before any flexbox enhancement.

Why did Gmail delete my entire style block or ignore media queries?

Gmail silently drops CSS rules under two documented conditions: first, if the cumulative size of all <style> blocks exceeds 16 KB (16,384 bytes), Gmail drops all subsequent CSS rules without warning; second, if a style block contains modern space-separated color syntax like rgb(0 0 0) instead of comma-separated rgb(0, 0, 0), or unclosed curly brackets, Gmail drops the entire <style> element.

Your next question

Also useful: CSS Compatibility Checker · border-radius in Outlook Classic: the fix · display:flex in Outlook Classic: the fix

Paste the email that broke.

The checker needs a computer screen.

Get new email CSS fixes by email, or follow by RSS.