Skip to content

Outlook Background Image Generator

Classic Outlook for Windows ignores CSS background images. Enter your image, size and fallback colour, and copy code that shows the background there too — VML for Outlook, CSS for every other email app.

A JPG or PNG online, on https. Twice the area’s size keeps it sharp.

px
px
px
Height

Preview (as in Gmail and Apple Mail)

HTML + VML code
<table role="presentation" width="600" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="https://keshurgojiya.com/assets/img/tools/email-background-sample.jpg" bgcolor="#1f3d31" width="600" height="300" valign="top" style="background-color:#1f3d31;background-image:url('https://keshurgojiya.com/assets/img/tools/email-background-sample.jpg');background-position:center;background-repeat:no-repeat;background-size:cover;height:300px;">
      <!--[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="https://keshurgojiya.com/assets/img/tools/email-background-sample.jpg" color="#1f3d31" />
        <v:textbox inset="0,0,0,0">
      <![endif]-->
      <div>
        <table role="presentation" width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td style="padding:48px;">
              <h1 style="margin:0 0 12px;font-family:Arial, Helvetica, sans-serif;font-size:32px;line-height:1.2;color:#ffffff;">Your headline here</h1>
              <p style="margin:0;font-family:Arial, Helvetica, sans-serif;font-size:16px;line-height:1.5;color:#ffffff;">A line of text on top of the background image.</p>
            </td>
          </tr>
        </table>
      </div>
      <!--[if gte mso 9]>
        </v:textbox>
      </v:rect>
      <![endif]-->
    </td>
  </tr>
</table>
How to use it

Using the outlook background image generator

  1. Enter the image’s URL (it has to be online, on https), the size of the area and a fallback colour.

  2. Write or paste the content that goes on top of the image.

  3. Copy the code into your template and send a test to Outlook.

Why background images don’t show in Outlook

Classic Outlook for Windows renders email with Microsoft Word, which doesn’t support background images in CSS. It does support VML, Microsoft’s old vector format, which can fill a shape with an image.

This code adds a VML rectangle inside a conditional comment that only Outlook reads, fills it with your image and puts your content in a text box on top. Every other email app uses the CSS background on the table cell and ignores the VML.

Fixed height or growing with the content

With a fixed height, the image area is always the same size, which suits a banner. With “grow with content”, the area grows to fit your text, which is useful when the text’s length changes.

Either way, choose a fallback colour close to the image’s main colour. It shows while the image loads and when images are off, and your text should stay readable on it.

FAQ

Questions, Answered

Does this work in the new Outlook and Outlook.com?

Yes. They render email like a browser and show the CSS background on the table cell. The VML part is read only by classic Outlook for Windows.

Why is my background image stretched in Outlook?

The VML fill stretches the image to fill the rectangle. Use an image with the same proportions as the area, for example 1200 × 600 px for a 600 × 300 px area (twice the size keeps it sharp on high-resolution screens).

Can I put a background image behind the whole email?

This tool makes one section, a table cell with a background, which is what most designs need. A background behind the entire email uses a different VML element on the <body>.

Do I need to change my <html> tag?

No: the code declares the VML namespace on the shape itself. Many templates also declare it on the <html> tag (xmlns:v="urn:schemas-microsoft-com:vml"), which does no harm.

Is the code free to use?

Yes. Use it in any email, for yourself or for clients; no credit needed.

Need an HTML email built or fixed?

I code responsive HTML email templates and signatures that work in Outlook, Gmail and Apple Mail, or fix the one you already have. Tell me what you need.

Email me