HTML Email Compatibility Guide 2026 — Outlook, Gmail & Dark Mode
Everything email developers need to know about HTML email compatibility: Outlook rendering quirks and VML, Gmail CSS support, dark mode, and how to test before you send.
An email that looks perfect in your browser can arrive broken in a subscriber's inbox, because every email client renders HTML its own way. This guide walks through the clients that cause the most trouble, why they behave the way they do, and the practical patterns that keep a campaign readable everywhere. It is written for marketers, designers and developers who want fewer surprises after they hit send.
Why HTML email compatibility is still hard
Web browsers converged on shared standards years ago. Email clients did not. An email is rendered by whatever engine the recipient's client uses, and those engines differ wildly:
- Outlook for Windows (classic desktop versions) renders HTML with Microsoft Word's layout engine, not a browser engine.
- Gmail runs your markup through its own sanitizer, rewrites class names and removes CSS it does not allow.
- Apple Mail and iOS Mail use WebKit and support most modern CSS.
- Webmail and mobile apps each add their own wrappers, styles and dark mode behavior on top of your code.
You cannot control which client a subscriber uses, so email client compatibility comes down to one principle: write markup that the least capable client can render, then layer improvements on top for the clients that support them. This is often called progressive enhancement, or graceful degradation when viewed from the other side.
The baseline that works almost everywhere
Before looking at individual clients, it helps to know the foundation that experienced email developers rely on:
| Technique | Why it matters |
|---|---|
| Table-based layout | Tables are the one layout model every client understands, including Outlook's Word engine. |
| Inline styles | Some clients and forwarding paths drop <style> blocks, so critical styles belong on the element. |
| Fixed 600px-ish content width | Fits preview panes and desktop clients, then scales down on mobile. |
| Web-safe font fallbacks | Custom fonts load only in some clients; the rest need a sensible fallback. |
| Explicit image dimensions | Prevents layout jumps and odd scaling, especially in Outlook. |
bgcolor attributes alongside CSS |
Gives older clients a background color even when CSS backgrounds are ignored. |
A minimal, robust skeleton looks like this:
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="center" bgcolor="#F4F4F4">
<table cellpadding="0" cellspacing="0" border="0" width="600"
style="width: 600px; max-width: 600px;">
<tr>
<td style="padding: 24px; font-family: Arial, Helvetica, sans-serif;
font-size: 16px; line-height: 24px; color: #222222;">
Hello from a table-based layout.
</td>
</tr>
</table>
</td>
</tr>
</table>
Everything else in this guide builds on that idea.
Outlook HTML email: the Word engine and its quirks
Most compatibility headaches trace back to Outlook for Windows. The classic desktop versions use Word to render HTML, which means a large part of modern CSS simply does not exist there. Newer Outlook apps, including Outlook on the web and the new Outlook for Windows, behave much more like a browser, but many organizations still run the classic desktop client, so it is worth designing for it.
What classic Outlook ignores or breaks
max-widthis not supported, so fluid containers can stretch across the whole window.marginis unreliable. Spacing should come frompaddingon table cells or from spacer rows.- CSS background images are not displayed. Classic Outlook needs either VML (Vector Markup Language) or the HTML
backgroundattribute, plus a solid fallback color. border-radiusis ignored, so rounded buttons and cards render with square corners.- Gradients are not rendered. Without a fallback color, the area may show as blank.
colspanandrowspancan produce unpredictable layouts. Nested tables are safer.- Fixed heights combined with padding often add up in unexpected ways, making blocks taller than intended.
- Web fonts are not loaded, and naming a custom font in an inline
font-familycan cause Outlook to fall back to Times New Roman instead of your intended fallback.
Conditional comments: talking to Outlook directly
Outlook understands special conditional comments that other clients treat as ordinary HTML comments. They let you give Outlook its own markup without affecting anyone else. The most common use is a fixed-width wrapper, because Outlook ignores max-width:
<!--[if (gte mso 9)|(IE)]>
<table cellpadding="0" cellspacing="0" border="0" width="600"><tr><td>
<![endif]-->
<table cellpadding="0" cellspacing="0" border="0" width="100%"
style="max-width: 600px;">
<!-- content -->
</table>
<!--[if (gte mso 9)|(IE)]>
</td></tr></table>
<![endif]-->
Modern clients use the max-width table and scale it down on mobile. Outlook sees the fixed 600px table and keeps the layout intact.
It is also common to add an Office settings block in the <head>, which helps Outlook handle PNG images and avoids some scaling issues on high-DPI Windows displays:
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
Background images and VML
If a hero banner has text over a background photo, classic Outlook is where it usually falls apart. There are three levels of support you can aim for:
- Solid color fallback. Always set
bgcoloron the cell so text stays readable even if no image appears. - The
backgroundattribute. Some Outlook versions respect<td background="...">, which is quick to add. - VML. For full control in classic Outlook, wrap the content in a VML rectangle with an image fill inside a conditional comment. It works, but it is verbose, sensitive to exact dimensions, and easy to break when the design changes.
A layered fallback for a background cell looks like this:
<td align="center" bgcolor="#1A1A2E"
background="https://example.com/hero.jpg"
style="background: url('https://example.com/hero.jpg') center / cover no-repeat;
background-color: #1A1A2E; padding: 48px 24px;">
<!-- headline and button -->
</td>
A practical rule: if the text in a banner is essential, consider keeping it as live HTML text over a solid color rather than relying on a background image at all. If the design depends on the image, test it specifically in classic Outlook.
Bulletproof buttons
Buttons made from images disappear when images are blocked, and buttons styled with padding on a link often lose their clickable area in Outlook. The safer pattern is a button built from a table cell with a background color, an explicit height, and a line-height that matches the height so the label stays vertically centered:
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" valign="middle" height="48" bgcolor="#2563EB"
style="height: 48px; border-radius: 6px;">
<a href="https://example.com"
style="display: block; padding: 0 28px; font-family: Arial, sans-serif;
font-size: 16px; line-height: 48px; color: #FFFFFF;
text-decoration: none; white-space: nowrap;">
Shop the sale
</a>
</td>
</tr>
</table>
In Outlook the corners will be square, which is an acceptable degradation. Everywhere else the button keeps its rounded shape. For a deeper look at Outlook-specific bugs, see our article on common Outlook HTML email issues.
Gmail HTML email: sanitizing, CSS support and clipping
Gmail is far more capable than classic Outlook, but it has rules of its own. Because so many subscribers read email in Gmail's web and mobile apps, it deserves dedicated attention.
What Gmail supports
- Embedded
<style>blocks in the<head>are supported in Gmail's own web and mobile apps, including media queries. This is what makes responsive email possible there. - Class and ID selectors work, though Gmail rewrites class names behind the scenes.
- Common CSS properties for color, typography, padding, borders and backgrounds are generally fine.
Where Gmail trips people up
- One error can drop the whole style block. If Gmail's parser dislikes something in your
<style>tag, it may discard all of it. Keep embedded CSS simple and validate it. - Non-Gmail accounts in Gmail apps (for example, a work or other provider's address added to the Gmail app) can have weaker CSS support than native Gmail accounts. Inline styles are your safety net here.
- Size limits. Gmail clips messages whose HTML is larger than roughly 102 KB and shows a "View entire message" link. Anything after the cut, which often includes the unsubscribe link and tracking pixel, is hidden until the reader clicks.
- Images are proxied. Gmail serves images through its own servers, so image URLs must be publicly reachable.
Keeping emails under the clipping limit
The limit applies to the HTML code, not to images, which are loaded separately. To stay safely under it:
- Remove unused CSS and repeated inline declarations where your workflow allows.
- Avoid deeply duplicated markup, such as separate desktop and mobile versions of the same block.
- Watch what your ESP adds: tracking parameters on every link and template wrappers increase size.
- Check the final size of the HTML your ESP actually sends, not just the file you exported.
Mobile clients and responsive email
Most email is now opened on phones, so responsive behavior is part of compatibility, not a bonus.
Media queries with a fallback
The common approach is a desktop-width layout that switches to a single column below a breakpoint, usually just under the content width:
@media only screen and (max-width: 598px) {
.mob-full { width: 100% !important; max-width: 100% !important; }
.mob-stack { display: block !important; width: 100% !important; }
.mob-pad { padding-left: 16px !important; padding-right: 16px !important; }
}
Because some clients ignore media queries, the desktop layout must still be readable when it is shown on a small screen. A 600px layout that scales down proportionally is much better than one that overflows sideways.
Mobile details that matter
- Text size. Use at least 14px for body text. iOS Mail may enlarge text smaller than about 13px on its own, which can break layouts, and the
-webkit-text-size-adjustsetting helps control that. - Apple's auto-formatting. The
x-apple-disable-message-reformattingmeta tag stops Apple Mail from resizing your content unexpectedly. - Viewport meta tag. Include it so mobile clients scale the email correctly.
- Tap targets. Buttons should be large enough to tap comfortably, and wide buttons should expand to full width on small screens.
- Images. Use
widthattributes with the desktop value, plusmax-width: 100%andheight: autobehavior for images that should shrink.
If you design in Figma, our guide to responsive email design in Figma covers how to set up frames so they translate cleanly into stacked mobile layouts.
Dark mode email: three behaviors you need to plan for
Dark mode is the newest major compatibility challenge, and it is tricky because clients handle it in different ways. Broadly, they fall into three groups:
| Behavior | What happens | Your control |
|---|---|---|
| No change | The email renders exactly as designed. | Full |
| Partial inversion | Light backgrounds are darkened and dark text is lightened; already dark areas are usually left alone. | Limited |
| Full inversion | Most colors are inverted, including some you intentionally made dark. | Very limited |
Clients that respect the prefers-color-scheme media query, such as Apple Mail, let you supply your own dark palette. Others, including several Gmail and Outlook apps, apply their own color changes regardless of what your CSS says. Which behavior a specific client uses can change between app versions, so testing beats memorizing a list.
Opting in where it is supported
Where a client honors your styles, you can declare that the email supports both schemes and provide dark overrides:
<meta name="color-scheme" content="light dark">
<meta name="supported-color-schemes" content="light dark">
<style>
@media (prefers-color-scheme: dark) {
.dm-bg { background-color: #121212 !important; }
.dm-text { color: #EDEDED !important; }
}
</style>
Treat this as an enhancement. Many clients will ignore it and apply their own adjustments.
Designing so inversion does not hurt
Since you cannot fully control inverting clients, the most reliable strategy is designing assets that survive color changes:
- Use transparent PNGs for logos and icons so they do not sit in a white box on a dark background.
- Add a thin light outline or glow to dark logos so they stay visible when the background turns dark.
- Avoid text baked into images where possible. Live text adapts to dark mode; text in an image does not.
- Do not rely on pure black and pure white everywhere. Slightly off values often survive inversion more gracefully.
- Check brand colors in both themes. A color that passes contrast on white can become hard to read after inversion.
FigMail's email design best practices include these dark mode asset tips, and they are worth applying in Figma before you export anything.
Fonts, images and other cross-client details
Web fonts and fallbacks
Custom fonts load in Apple Mail, iOS Mail and some other clients, but not in classic Outlook or several webmail clients. A safe approach:
- Load the font with a
<link>or@importin the<head>. - Apply the custom font through a class in the embedded styles.
- Keep only web-safe fonts in the inline
font-family, such asArial, Helvetica, sans-serifor'Times New Roman', Times, serif.
<style>
.font-brand { font-family: 'Fira Sans', Arial, sans-serif !important; }
</style>
<div class="font-brand"
style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 24px;">
Brand font where supported, Arial everywhere else.
</div>
This way clients that support web fonts get your brand typeface, and Outlook falls back to Arial instead of Times New Roman.
Images
- Design at 1x (600px wide) and export images at 2x so they look sharp on high-density screens.
- Always set
widthin the HTML, addborder="0", and usedisplay: blockto remove the small gap some clients add under images. - Write meaningful
alttext. Many clients block images by default, and the alt text is what readers see first. - Keep important messages, prices and calls to action in live text, not only in images.
Preheader text
The preheader is the preview snippet shown after the subject line. If you do not set one, clients pull the first text they find, which might be "View in browser." A hidden preheader span at the top of the body, followed by filler characters, keeps the preview clean and intentional.
Spacing without margins
Because margins are unreliable across clients, spacing is usually created with padding on table cells or with dedicated spacer rows. Negative margins, which are common in web layouts, should be avoided entirely.
How to test across email clients
No checklist replaces seeing the email in real clients. A practical testing routine looks like this:
- Validate the HTML. Check for unclosed tags and CSS syntax errors, since a single error can cause Gmail to drop your styles.
- Send real test emails to accounts you control: Gmail on web and mobile, Outlook on Windows and the web, Apple Mail on Mac and iPhone, and any client your audience uses heavily.
- Use an email preview service. Dedicated rendering tools generate screenshots across a large number of client, device and dark mode combinations in one run. They save time, though a few real inbox checks are still worth doing.
- Test dark mode separately. Switch your devices to dark mode and review the same sends again.
- Test with images off. Make sure the message still makes sense from alt text and live text alone.
- Check the message size the ESP actually sends, to stay clear of Gmail clipping.
- Click every link and button in at least one desktop and one mobile client.
Your ESP's analytics can show which clients your subscribers actually use. Focus your manual testing on the top few, and let a preview tool cover the long tail.
A quick pre-send checklist
- Table-based layout with a fixed-width Outlook wrapper
- Inline styles on every visible element
bgcolorfallbacks for every background color, image and gradient- No
colspan,rowspan, negative margins oroverflow - Bulletproof, table-based buttons
- Web-safe fallbacks for custom fonts
- Responsive media queries, plus a layout that still reads without them
- Dark mode friendly logos and icons
- Preheader text set
- HTML size comfortably below the clipping limit
How FigMail helps with HTML email compatibility
Hand-coding all of these patterns is slow, and it is easy to forget one when a deadline is close. FigMail is a Figma plugin that converts an Auto Layout frame into table-based HTML email, following rules built around the compatibility issues described above. Based on the rules the generator follows, that includes:
- Table-based structure with inline styles and reset table attributes
- An MSO conditional wrapper for Outlook's missing
max-widthsupport, plus Outlook settings in the<head> bgcolorandbackgroundattribute fallbacks for background images, and an average-color fallback for gradients- Table-based buttons with matching
heightandline-height - Spacing through padding and spacers instead of margins, with no
colspanorrowspan - Media queries that stack columns and resize elements on mobile
- Google Fonts connected through classes, with web-safe fallback fonts kept inline for Outlook
- Apple reformatting and viewport meta tags, and a hidden preheader
Some things still depend on your design. FigMail does not replace testing, rich background layouts may still need a manual check in classic Outlook, and dark mode results depend heavily on how your logos and images are prepared. That is why the best practices page recommends Auto Layout, a 600px width, web-safe fonts, transparent assets and avoiding complex background images when Outlook support matters.
Next steps
If you design emails in Figma, the fastest way to see these patterns in practice is to export one of your own frames and run it through your usual tests.
- Read how FigMail works and the feature overview.
- Prepare your file with the email design best practices, and see how to design HTML emails in Figma.
- Send the result to your ESP, such as Mailchimp, Klaviyo or SendGrid, or open it in the Blocks editor to adjust copy and images visually.
- Install the FigMail plugin and try it on the Free plan, which includes 3 generations a month. Paid plans are listed on the pricing page.
Turn your Figma frame into HTML email
Install the FigMail plugin and get your first emails converted free.
Get the Figma plugin