Outlook Background Images: Copy-Paste VML That Works
Outlook Classic does not render CSS background images, so wrap the cell in a VML v:rect with a v:fill inside an mso conditional comment, and keep a solid background colour as the fallback.
Works in 16 of 21. Not supported in Outlook Classic. Partial in Yahoo Mail, Yahoo Mail Android, Yahoo Mail iOS and 1 more.
Every client by level
- Works
- Gmail, Gmail Android, Gmail iOS, Outlook 365, Outlook (New), Outlook iOS, Outlook Android, Outlook for Mac, Apple Mail, Apple Mail iOS, Samsung Mail, Thunderbird, HEY Mail, Proton Mail, Fastmail, Superhuman
- Partial
- Yahoo Mail, Yahoo Mail Android, Yahoo Mail iOS, AOL Mail
- Not supported
- Outlook Classic
What to do instead in Outlook Classic
Use VML for background images in Outlook
<td background="hero.jpg" bgcolor="#333333" width="600" height="300" valign="top"
style="background-image: url('hero.jpg'); background-size: cover;">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true"
stroke="false" style="width:600px; height:300px;">
<v:fill type="frame" src="hero.jpg" color="#333333" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div style="padding: 40px;">
<h1 style="color: #fff;">Hello World</h1>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td> Show the original
<td style="background-image: url('hero.jpg');
background-size: cover; padding: 40px;">
<h1 style="color: #fff;">Hello World</h1>
</td> 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 28 Oct 2026
@emailens/engine 0.19.3 · data last changed 10 Nov 2026
Part of the HTML email guide · all guides
An email background image that shows in Gmail and Apple Mail disappears in Outlook Classic on Windows (Outlook 2016, 2019, 2021 and enterprise 365), leaving an empty block or unreadable text. The fix is a few lines of Vector Markup Language (VML) that only Outlook reads. Here is the VML background image pattern, the full-width version, the high-DPI fixes, and the one nesting mistake that breaks every VML shape below it.
Why background images disappear in Outlook
Outlook Classic renders email with Microsoft Word's engine rather than a browser; the Outlook CSS support guide explains the engine. For background images, it means Word drops all of the following before it renders:
- It completely strips
background-imagedeclarations from inline styles. - It drops the legacy HTML
background="..."attribute on<table>and<td>tags. - It strips CSS gradients (
linear-gradientandradial-gradient); the gradient fallback is in Outlook CSS fallbacks.
The danger lies in development previews. Because browser-based preview tools, Figma email plugins, and local servers render both background-image and the HTML attribute natively, developers assume the email works. When delivered to a corporate recipient on Outlook 2019, the background simply disappears.
<!-- Broken: the background disappears in Outlook Classic -->
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td
background="https://example.com/hero.jpg"
style="background-image: url('https://example.com/hero.jpg');
background-size: cover;
background-position: center;
padding: 48px 24px;
text-align: center;"
>
<h1 style="color: #ffffff; margin: 0 0 16px;">Summer Launch Event</h1>
<p style="color: #ffffff; margin: 0;">Join us live on October 15th.</p>
</td>
</tr>
</table>
<!--
Apple Mail, Gmail and iOS: the hero image renders.
Outlook 2016/2019/365 on Windows: background-image and background="..." are stripped.
With no fallback background-color, the white text sits on a white background and disappears.
-->Notice what happens when white text (color: #ffffff) sits over a dark photo without an explicit fallback color. When Outlook strips the photo, Word renders the default white background of the email client, rendering your headline completely invisible (white text on white background). Always declare a matching solid bgcolor and background-color.
The VML background image: v:rect, v:fill and v:textbox
To render background graphics in Word, we use Vector Markup Language (VML), an XML-based vector format standardized by Microsoft in 1998. While deprecated in Internet Explorer 10, Word continues to support VML natively for drawing shapes and image fills.
The standard pattern (originally pioneered by Stig Mortensen at Campaign Monitor) wraps three VML elements inside an MSO conditional comment, which other clients read as a comment (how conditional comments work):
<v:rect>: Draws a rectangular vector shape. Must declare the VML namespacexmlns:v="urn:schemas-microsoft-com:vml",fill="true",stroke="false", and explicit width and height in its style attribute.<v:fill type="frame">: Instructs VML to fill the shape with a bitmap image. The attributetype="frame"fits the image to the box (mirroring CSSbackground-size: cover). Thecolorattribute provides the fallback tint while the image downloads.<v:textbox inset="0,0,0,0">: Acts as the container for child HTML. Crucially, theinset="0,0,0,0"attribute resets Word's default internal margins to zero. Without this, Word adds an unwanted 7.2pt padding on all sides.
<!-- VML background image for Outlook Classic, CSS for everyone else -->
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td
align="center"
valign="top"
bgcolor="#1e1b4b"
background="https://example.com/hero.jpg"
style="background-image: url('https://example.com/hero.jpg');
background-position: center center;
background-size: cover;
background-color: #1e1b4b;"
>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style="width: 600px; height: 320px;">
<v:fill type="frame" src="https://example.com/hero.jpg" color="#1e1b4b" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div style="max-width: 600px; margin: 0 auto;">
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="padding: 48px 24px; text-align: center;">
<h1 style="margin: 0 0 16px; font-family: Arial, sans-serif; font-size: 28px; line-height: 36px; font-weight: bold; color: #ffffff;">
Summer Launch Event
</h1>
<p style="margin: 0; font-family: Arial, sans-serif; font-size: 16px; line-height: 24px; color: #e2e8f0;">
Join us live on October 15th for the keynote announcement.
</p>
</td>
</tr>
</table>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>Keeping text sharp: the dual-shape VML pattern
While the classic single-rect pattern works well for simple cards, it exhibits a known rendering bug in certain Office 365 desktop builds: applying opacity or color filters to <v:fill> can cause the background color to bleed into child text nodes, reducing contrast.
To solve this, modern email generators, including our free Outlook VML Background Generator, use two shapes: one draws the image, the other holds the text. That keeps the image layer apart from the text:
<!-- Dual-shape VML pattern (used by the Emailens generator) -->
<!-- Keeps the image layer and the text layer apart -->
<div style="background-color: #0f172a;">
<!--[if mso]>
<v:image xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style="width: 600px; height: 300px;" src="https://example.com/hero.jpg" />
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style="position: absolute; width: 600px; height: 300px;">
<v:fill opacity="0%" color="#0f172a" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
<!--[if mso]><table role="presentation" border="0" cellpadding="0" cellspacing="0" width="600"><tr><td><![endif]-->
<div style="background-image: url('https://example.com/hero.jpg');
background-position: center center;
background-size: cover;
background-color: #0f172a;
max-width: 600px;
height: 300px;">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%" height="300">
<tr>
<td align="center" valign="middle" style="padding: 24px;">
<h1 style="margin: 0; font-family: Arial, sans-serif; font-size: 28px; line-height: 36px; font-weight: bold; color: #ffffff; text-align: center;">
Save 30% On Your Upgrade
</h1>
</td>
</tr>
</table>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<!--[if mso]>
</v:textbox>
</v:rect>
<![endif]-->
</div>In this architecture, <v:image> renders the underlying photograph as a dedicated background canvas. Immediately following it, an absolutely positioned <v:rect> with an invisible fill (opacity="0%") hosts the <v:textbox>, so no colour from the image layer reaches your text.
Full-width background images in Outlook
A frequent design requirement is a full-bleed hero: a background image that spans 100% of the viewport on wide screens, with the text content centered in a 600px column.
In CSS, this is straightforward: a wrapper <table width="100%"> holds the background, while an inner <div style="max-width: 600px; margin: 0 auto;"> constrains the text. But Outlook ignores both width: 100% on VML shapes and max-width on divs.
The solution requires two Outlook-specific techniques combined:
mso-width-percent: 1000: Word expresses percentage widths in tenths of a percent. Settingstyle="mso-width-percent: 1000;"on the<v:rect>commands Word to expand the vector rectangle to exactly 100% of the reading pane.- An inner ghost table: Inside the
<v:textbox>, nest an MSO conditional table withwidth="600"to prevent your headlines from stretching edge-to-edge on large desktop monitors. How ghost tables work is in Outlook ghost tables.
<!-- Full-width VML hero banner -->
<table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td
align="center"
valign="top"
bgcolor="#064e3b"
background="https://example.com/banner-wide.jpg"
style="background-image: url('https://example.com/banner-wide.jpg');
background-position: center top;
background-size: cover;
background-color: #064e3b;"
>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false"
style="mso-width-percent: 1000; height: 260px;">
<v:fill type="frame" src="https://example.com/banner-wide.jpg" color="#064e3b" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<!-- Center content inside 600px reading width -->
<div style="max-width: 600px; margin: 0 auto;">
<!--[if mso]><table role="presentation" width="600" border="0" cellpadding="0" cellspacing="0"><tr><td><![endif]-->
<div style="padding: 40px 20px; text-align: center;">
<h2 style="margin: 0; font-family: Arial, sans-serif; font-size: 24px; color: #ffffff;">
Full-Bleed Header Across All Screens
</h2>
</div>
<!--[if mso]></td></tr></table><![endif]-->
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>VML background images on high-DPI Windows displays
Windows laptops with high-resolution displays (Surface devices or 4K monitors, for example) set display scaling to 125%, 150% or 200%, and Outlook Classic scales VML with it.
When Classic Outlook runs under 120 DPI (125% scaling) or 144 DPI (150% scaling), Word recalculates pixel values. If your VML code declares style="width: 600px; height: 300px;", Outlook scales the VML canvas to 750px or 900px, causing the hero banner to balloon out of proportion or distort aspect ratios.
| Display Setting | DPI Value | Scaling Factor | VML Scaling Impact |
|---|---|---|---|
| Standard 100% | 96 DPI | 1.0x | Exact 1:1 pixel rendering |
| Windows 125% | 120 DPI | 1.25x | 600px canvas expands to 750px |
| Windows 150% | 144 DPI | 1.5x | Distorts non-vector bitmap elements |
To keep VML backgrounds at the size you set on scaled Windows displays:
- Declare PixelsPerInch in <head>: Put Word's
<o:PixelsPerInch>96</o:PixelsPerInch>directive inside an MSO conditional comment in the email<head>. This forces Word to retain a 96 DPI baseline, preventing shapes from ballooning when Windows scaling is set to 125% or 150%. - A 2x image: Export your background image at double resolution (1200x600 for a 600x300 hero), but specify the 1x dimensions (600px and 300px) in both the HTML attributes and VML style tags.
- The VML and Word namespaces: Ensure your email's outer
<html>tag includes both the VML and Word namespaces:xmlns:v="urn:schemas-microsoft-com:vml"andxmlns:w="urn:schemas-microsoft-com:office:word". Word uses theoffice:wordschema to interpret scaling rules properly. - Whole-pixel dimensions: Never use fractional pixels or decimal values in VML styles. Round to integers to avoid sub-pixel rounding.
<!-- Place inside the <head> of your email HTML -->
<!-- Enforces 96 DPI coordinate baseline on 120 DPI & 144 DPI Windows displays -->
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->Never put a VML button inside a VML background
This is the most common reason developers report that their VML hero background “broke Outlook entirely.”
Rounded buttons for Outlook are often built with VML using <v:roundrect> (the pattern is in border-radius in Outlook). If a designer puts a rounded CTA button inside a hero section with a background image, developers naturally place the button code inside the hero section.
Outlook does not render nested VML shapes. In the Emailens Engine VML analyzer (vml-checker.ts), shape elements (v:rect, v:roundrect, v:oval, v:image) are tracked as a stack. When Outlook encounters one shape inside another (for example, a <v:roundrect> inside the <v:textbox> of a <v:rect>), Word's rendering engine corrupts its internal layout state.
Testing with probe fixtures in the Emailens test suite shows two separate failures:
- The container shape vanishes. The parent
<v:rect>does not render at all. Its image fill and bounding geometry disappear completely, leaving the inner content stranded without its background canvas. - Every VML shape below loses its text. The damage is not confined to the hero section. Every VML shape further down the entire email stops drawing its text. Buttons and badges located hundreds of pixels below the hero turn into blank colored boxes without visible labels. Emailens verified this with byte-identical probe buttons placed before and after a nested shape: the probe before renders its label, while the identical probe after drops its text completely.
What does not happen: email lore often claims that shape nesting terminates the table structure early, causing content to spill outside the email frame. Testing against real Word engine builds proves the table structure remains intact; only the VML background fills and subsequent VML text nodes are destroyed.
<!-- Broken: a VML button nested inside a VML background -->
<!-- Outlook does not render nested VML shapes -->
<!--[if gte mso 9]>
<v:rect ... style="width: 600px; height: 350px;">
<v:fill type="frame" src="hero.jpg" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<h1>Hero Title</h1>
<!-- Do not do this: <v:roundrect> inside <v:rect> -->
<!--[if mso]>
<v:roundrect href="https://example.com" ...>
<center>Click Me</center>
</v:roundrect>
<![endif]-->
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
<!-- Fixed: a table-cell button inside the hero instead -->
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="margin: 20px auto 0;">
<tr>
<td
align="center"
bgcolor="#6d28d9"
style="border-radius: 6px; background-color: #6d28d9;"
>
<a
href="https://example.com"
style="display: inline-block; padding: 12px 28px; font-family: Arial, sans-serif;
font-size: 15px; font-weight: bold; color: #ffffff; text-decoration: none;"
>
Explore Product →
</a>
</td>
</tr>
</table>The fix: whenever a call-to-action button sits inside a VML background container, do not use a VML button. Instead, use a standard table-cell button with inline padding and border-radius. Modern clients render the rounded corners, while Outlook renders a clean, functional rectangular button and keeps the VML background.
Generate the VML instead of writing it by hand
Writing VML by hand is error-prone. A single missing namespace, unclosed conditional tag, or mismatched height silently breaks the background in Outlook.
Use the free Outlook VML Background Generator. It provides:
- Pre-configured presets for Hero Headers, Promo Cards, Announcement Banners, and Compact Notices.
- Automatic dual-shape layering to prevent text bleed and opacity artifacts.
- Live preview of desktop and mobile rendering, side by side.
- One-click copy-paste HTML ready for your email service provider.
Once generated, validate your template through the Emailens CSS Compatibility Checker or preview it across all 21 clients before you send.
Questions
Why do background images disappear in desktop Outlook?
Classic Outlook on Windows (2007 through 2024 and Microsoft 365 desktop) renders HTML using the Microsoft Word engine, which strips both the CSS background-image property and the legacy HTML background attribute on table cells. The only way to display a background image with overlay text in Word-based Outlook is using Microsoft's proprietary Vector Markup Language (VML) inside MSO conditional comments.
What is the difference between v:fill type='frame' and type='tile'?
In VML, type='frame' scales the background image to fill the exact dimensions of the bounding v:rect shape without repeating (similar to CSS background-size: cover or contain). In contrast, type='tile' repeats the image horizontally and vertically across the container (similar to CSS background-repeat: repeat). For hero banners, type='frame' is standard.
Can I nest a VML button inside a VML background image container?
No. Outlook strictly refuses to nest VML shapes. Placing a VML rounded button (<v:roundrect>) inside a VML background shape (<v:rect>) causes the container background to disappear completely, leaving the inner content stranded. Furthermore, it triggers downstream text suppression: all subsequent VML shapes further down the email stop rendering their text labels, turning downstream buttons into blank colored blocks. For CTA buttons placed over VML backgrounds, use table-cell padding with inline styles and border-radius instead.
How do I make a VML background image responsive or full width?
For fixed-width templates (e.g. 600px), set explicit width and height values in both px and VML style attributes. For full-width fluid banners, use Word's proprietary percentage notation mso-width-percent: 1000 (where 1000 represents 100% width) on the v:rect shape, paired with an inner centered ghost table to constrain the readable content area.
Your next question
Also useful: Outlook VML Background Generator · Bulletproof Button Generator · background-image in Outlook Classic: the fix
Paste the email that broke.
No signup · Five clients free, Outlook Classic included · All 21 with an account
The checker needs a computer screen.
Every account includes one free real-device check in classic Outlook and Apple Mail, after you verify your email and run one preview, while this month's free capacity lasts. How real-device checks work →
Get new email CSS fixes by email, or follow by RSS.