If you have built web pages, your first HTML email will humble you. Flexbox, grid, max-width, margins on block elements, background images: they all work in Apple Mail and most webmail, and then fall apart in one client. That client is classic Outlook for Windows, and the reason is unusual enough to be worth understanding before you write a line of code.
Why Outlook is different
The classic desktop Outlook for Windows (versions 2007 through the current Microsoft 365 desktop app in "classic" mode) does not render email with a browser engine. It uses Microsoft Word's HTML renderer. Word was built to lay out documents, and it supports a subset of HTML and CSS from roughly the early 2000s.
Microsoft's newer Outlook for Windows, and Outlook on the web, use a browser engine and behave much like other webmail. But classic Outlook is still installed on a very large number of business desktops, and Microsoft has said it will be supported for years. If your readers are businesses, design for it.
Everything below follows from "it is Word".
Layout: tables, not divs
Word understands tables well. It does not understand flexbox, grid, floats or positioning. So email layouts are built from nested tables:
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" style="padding:24px 12px;">
<!-- content -->
</td>
</tr>
</table>
role="presentation"tells screen readers this is a layout table, not data, so they do not announce rows and columns.cellpadding,cellspacingandborderset to0remove default spacing that Outlook adds.- Put spacing in
paddingon<td>, notmarginon<p>or<div>. Outlook's handling of margins is inconsistent; padding on table cells is reliable.
The fixed-width "ghost table"
A modern email is fluid: 100% wide on a phone, capped at 600 pixels on a desktop. You would write max-width:600px. Outlook ignores max-width, so the email stretches across a wide screen.
The fix is a table that only Outlook can see, using conditional comments:
<!--[if mso]>
<table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td>
<![endif]-->
<table role="presentation" width="100%" style="max-width:600px;" cellpadding="0" cellspacing="0" border="0">
<!-- the real content -->
</table>
<!--[if mso]>
</td></tr></table>
<![endif]-->
Everything inside <!--[if mso]> ... <![endif]--> is an HTML comment to every other client and real markup to Outlook. Outlook gets a fixed 600-pixel wrapper, and everyone else gets the fluid version. This pattern is called a ghost table, and you will use it constantly: for the main container, and for multi-column rows.
Columns that stack on phones
The same trick builds responsive columns without depending on media queries:
<!--[if mso]><table role="presentation" width="536"><tr><td width="268" valign="top"><![endif]-->
<div style="display:inline-block; width:100%; max-width:268px; vertical-align:top;">
...left column...
</div>
<!--[if mso]></td><td width="268" valign="top"><![endif]-->
<div style="display:inline-block; width:100%; max-width:268px; vertical-align:top;">
...right column...
</div>
<!--[if mso]></td></tr></table><![endif]-->
In browsers, the two inline-block divs sit side by side when there is room and wrap when there is not. In Outlook, the conditional table forces two fixed columns. Set font-size:0 on the parent cell, or the whitespace between the divs adds a gap that pushes the second column down.
Images
- Always set the
widthattribute (a number, nopx). Outlook ignores CSS widths on images and displays them at their natural size otherwise. A 1200-pixel retina image becomes 1200 pixels wide. - Add
display:blockto stop a thin gap appearing under images in table cells. - Write useful
alttext. Outlook often blocks images until the reader allows them, and the alt text is what they see first.
Buttons
A link styled with padding and a background colour works almost everywhere, but Outlook ignores padding on <a> elements, so the clickable area shrinks to the text. Two reliable options:
- Padded table cell. Put the background colour and padding on a
<td>, and the link inside it. The whole cell is coloured; only the text is clickable in Outlook, which is usually acceptable. - VML button. For a fully clickable button with rounded corners in Outlook, use VML (Microsoft's old vector format) inside a conditional comment:
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" href="https://example.com"
style="height:44px; v-text-anchor:middle; width:200px;" arcsize="12%" stroke="f" fillcolor="#2143d0">
<center style="color:#ffffff; font-family:Arial, sans-serif; font-size:16px; font-weight:bold;">Read the guide</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]><!-->
<a href="https://example.com" style="display:inline-block; padding:12px 24px; background:#2143d0; color:#ffffff; border-radius:6px; text-decoration:none; font-weight:bold;">Read the guide</a>
<!--<![endif]-->
The <!--[if !mso]><!--> form hides the normal link from Outlook while showing it everywhere else.
Fonts and line height
- If your
font-familystarts with a web font Outlook does not have, Outlook may fall back to Times New Roman instead of the next font in your stack. Put the web font in a<style>block wrapped in@media screen, which Outlook ignores, and set a safe stack likeArial, Helvetica, sans-serifinline. - Outlook adds extra space to line heights unless you set
mso-line-height-rule: exactly;alongsideline-height.
DPI scaling
On Windows machines set to 120 DPI or higher, Outlook scales some measurements and not others, and layouts break apart. Add this inside <head>:
<!--[if mso]>
<noscript><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript>
<![endif]-->
and declare the Office namespace on the <html> element: xmlns:o="urn:schemas-microsoft-com:office:office".
Inline your CSS last
Write styles in a <style> block while you work, because it is readable. Before sending, inline them, so they survive clients and forwarding paths that strip the head. Keep media queries and :hover rules in the <style> block; they cannot be inlined, and the clients that support them read them there. The CSS inliner does this and can also copy widths, heights and background colours onto HTML attributes, which Outlook trusts more than CSS.
Or start from something that already works
Every pattern above is built into the email template builder: ghost tables, hybrid columns, padded-cell buttons, image widths, the DPI fix. Export the HTML and carry on in the HTML email editor, which flags the CSS Outlook will ignore as you type, and check the result at phone and desktop widths in the email preview.
No preview other than Outlook itself is exact. But if the email is built on tables, uses padding instead of margins, and sets image widths as attributes, the surprises that remain are small ones.