Back to all posts
Why Outlook Breaks Your HTML Email (and How to Fix It)
HTML Development

Why Outlook Breaks Your HTML Email (and How to Fix It)

MW
Marcus WebbEmail Engineer
Published
9 min read

The Root Cause: Microsoft Word

Every email developer eventually faces the same moment of confusion: they've written clean, valid HTML and CSS that looks perfect in Gmail and Apple Mail, but Outlook renders it as a broken mess of overlapping elements and collapsing columns. Understanding why requires understanding one strange historical decision.

In 2007, Microsoft switched Outlook's HTML rendering engine from Internet Explorer's Trident to Microsoft Word's rendering engine. This was an enterprise decision — Word is deeply integrated into Microsoft's productivity suite and the engineering cost of maintaining two separate rendering stacks was significant. But the consequence for email developers has been severe: Outlook now renders HTML email through a word processing engine that predates modern CSS, ignores most of the HTML4 spec's layout properties, and has been only incrementally updated since.

This affects every version of Outlook from 2007 through Microsoft 365 (Office 365) on Windows. Outlook on Mac uses WebKit and renders well. The new Outlook app for Windows 11, shipping gradually in 2024, uses a web rendering engine. But in corporate environments — where Outlook market share is highest — the Word-based renderer remains dominant.

Column Layouts: The Most Common Break

The Problem

Multi-column layouts built with display: flex, display: grid, or CSS float don't work in Outlook. These properties are simply ignored. All elements fall into a single vertical stack, destroying any side-by-side layout you intended.

The Fix: HTML Tables

Use HTML tables for any layout that requires elements to sit side by side. This is the fundamental rule of Outlook-compatible email development: structure with tables, style with CSS.

<table width="600" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td width="300" valign="top">
      <!-- Left column content -->
    </td>
    <td width="300" valign="top">
      <!-- Right column content -->
    </td>
  </tr>
</table>

Yes, it's 1999 web development. This is the reality of email. The table-based layout stays intact in Outlook because Word has always supported basic HTML tables from its document editing roots.

Background Images: VML to the Rescue

The Problem

Outlook ignores CSS background images. background-image: url() on a div or table cell is stripped entirely. This breaks hero sections, decorative backgrounds, and any layout that relies on background imagery.

The Fix: VML Backgrounds

Vector Markup Language (VML) is an XML-based vector graphics format Microsoft developed in 1998. It's the only way to render background images in Outlook. Here's the pattern:

<!--[if mso]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" 
  style="width:600px;height:200px;">
  <v:fill type="frame" src="https://example.com/header-bg.jpg" color="#6b21a8" />
  <v:textbox inset="0,0,0,0">
<![endif]-->
  <!-- Content overlaid on the background -->
<!--[if mso]></v:textbox></v:rect><![endif]-->

The <!--[if mso]> wrapper ensures this VML code only runs in Outlook. Other clients render the regular CSS background from the element's style attribute.

Margin and Padding: Unreliable by Default

The Problem

Outlook applies margins and padding inconsistently, particularly on <div>, <p>, and <img> elements. A margin: 0 auto to center a block element often doesn't work. <p> tags have a default Word margin-bottom that adds unexpected whitespace.

The Fix

For spacing, use padding on <td> elements rather than margin on divs — table cell padding is reliable in Outlook. Reset default <p> margins explicitly:

<p style="margin: 0; padding: 0 0 16px 0;">Your text here.</p>

For image spacing, add display: block to images to remove the default inline baseline gap, and set border: 0 to prevent Outlook from adding a border to linked images.

Buttons: The Bulletproof Technique

The Problem

CSS-styled anchor tags that look like buttons break in Outlook. display: inline-block with padding produces a text link with no visual padding. border-radius on the button is ignored.

The Fix: VML Buttons

The most reliable approach is the VML button (also known as the "bulletproof button"). It uses VML to render the button shape in Outlook while using regular HTML/CSS for other clients:

<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" 
  href="https://postdrop.io" 
  style="height:44px;v-text-anchor:middle;width:180px;" 
  arcsize="10%" stroke="f" fillcolor="#6b21a8">
  <w:anchorlock/>
  <center style="color:#ffffff;font-family:sans-serif;font-size:14px;font-weight:bold;">
    Start Building Free
  </center>
</v:roundrect>
<![endif]-->
<!--[if !mso]><!-->
<a href="https://postdrop.io" style="background-color:#6b21a8;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:14px;font-weight:bold;line-height:44px;text-align:center;text-decoration:none;width:180px;">
  Start Building Free
</a>
<!--<![endif]-->

Web Fonts: Use System Font Stacks

The Problem

Outlook doesn't support web fonts loaded via @font-face or Google Fonts. It falls back to the default font — typically Times New Roman on Windows — which almost never matches your design intent.

The Fix

Define a comprehensive fallback font stack that degrades gracefully:

font-family: 'Your Webfont', -apple-system, BlinkMacSystemFont, 'Segoe UI', 
  Arial, sans-serif;

Segoe UI is the Windows system font and looks excellent in Outlook. If your design requires a specific brand font, check whether the font is a standard Windows system font (like Calibri or Trebuchet MS) that Outlook will render natively.

DPI Scaling Issues in Outlook

On high-DPI Windows displays (typically 125% or 150% scaling), Outlook scales your email layout proportionally. A 600px wide email at 125% DPI becomes 750px wide, which can overflow containers and break responsive breakpoints.

The fix: add this meta tag to your HTML <head>:

<meta name="viewport" content="width=device-width, initial-scale=1">

And for Outlook specifically, target the correct width using an Outlook-specific conditional style:

<!--[if mso]>
<style type="text/css">
  body, table, td, a { font-size: 14px !important; }
  table { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
</style>
<![endif]-->

Line Spacing and Paragraph Spacing

The Problem

Word adds default spacing between paragraphs. In Outlook, a <p> tag gets the same spacing that Word's "Normal" paragraph style defines — typically 8–10px of spacing below each paragraph, in addition to whatever CSS you specified. This creates visible gaps between elements that you didn't design.

It also affects line spacing. line-height set in CSS may be partially overridden by Word's internal line spacing rules, producing tighter or looser text than expected.

The Fix

Explicitly set mso-line-height-rule: exactly for elements where line-height precision matters:

<p style="line-height: 24px; mso-line-height-rule: exactly; margin: 0 0 16px 0;">
  Your paragraph text here.
</p>

The mso-line-height-rule: exactly property is Outlook-specific and tells Word to use the exact line-height value rather than Word's minimum line spacing calculation. Combine this with explicit zero top-margin and controlled bottom-margin on paragraphs to eliminate unexpected gaps.

Table Gaps and Spacing

The Problem

Outlook can add unintended spacing between table cells. This is usually caused by the default table cellspacing value or Word's interpretation of CSS border spacing. A 2px gap appearing between adjacent table cells can misalign a carefully designed layout.

The Fix

Always set cellpadding="0", cellspacing="0", and border="0" on every table. Also add the Outlook-specific MSO table spacing properties:

<table width="600" cellpadding="0" cellspacing="0" border="0" 
  style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt;">

The mso-table-lspace and mso-table-rspace properties set Outlook's internal table spacing to zero, closing the gaps. Add these to every structural table in your email.

Image Width Issues

The Problem

Outlook resizes images based on their CSS width property, but it doesn't always respect percentage widths or max-width. A full-width hero image with width: 100% may render at its natural pixel dimensions in Outlook, overflowing a 600px container and causing horizontal scrolling.

The Fix

Always specify explicit pixel dimensions in both the HTML width and height attributes and the CSS style attribute. For responsive images that need to shrink on mobile, use the HTML attribute for Outlook's fixed width and CSS for the responsive behavior in other clients:

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

Outlook respects the HTML width="600" attribute for a fixed 600px render. Other clients use the CSS width: 100%; max-width: 600px for fluid responsive behavior.

Testing Outlook Fixes

Every Outlook fix should be tested in the specific Outlook version you're targeting. Outlook 2016, 2019, and Microsoft 365 have different behaviors in subtle ways — a VML background that renders correctly in Outlook 2019 may have a slight vertical offset in Outlook 2016. Testing across multiple Outlook versions used to require maintaining separate Windows installations with each Office version installed.

Postdrop.io renders previews across multiple Outlook versions simultaneously in your browser, making it practical to verify your fixes work across versions without the overhead of managing multiple Windows setups. Iterate on your code and see the render update across Outlook 2016, 2019, and 2021 at the same time.

The golden rule of Outlook development: never assume an Outlook fix works until you've seen it rendered in Outlook. What looks like correct source code often surprises you when Word processes it. The conditional comment pattern (<!--[if mso]>) is your most reliable tool — use it to inject Outlook-specific overrides without affecting other clients, and test every conditional comment path explicitly.

Outlook is genuinely difficult, but it's a solvable problem. The table-based layout foundation, VML for backgrounds and buttons, explicit spacing resets, and MSO-specific properties give you everything you need to build emails that look right even in the most restrictive versions of Outlook. Master these patterns once and they become muscle memory.

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