Home Resources Blog

Adding background images to email? We’ve already done the hard work for you. Check out Stig‘s ‘Bulletproof Email Background Images’ code generator at backgrounds.cm

Also, a more elegant and up-to-date method for displaying background images can be found here.

We often get asked about the best way to add a background image to an email newsletter. Well, the good news is that there’s a reliable way to get a repeating background image to surround your content in most major email clients, including Gmail and Outlook 2007! In this post, we’ll walk through two techniques which can be combined to give your design some background image love.

The table attribute approach

Look, I’ve written some darn ugly code in my time, but I still get itchy when I use tables. In so much as we shy from them, it should come as no surprise to you folks at home that a fair few table attributes are fairly well supported by the major email clients… And in particular, background.

So, the first thing you can do is to wrap your newsletter content in a table of width="100%", so it spans the width of the reading pane. Then, add the attribute, background=background_image.png and it should all be roses. Here’s how:

<table width="100%" border="0" cellspacing="0" cellpadding="20" background="background_image.png">
<p>Content on a pretty background image.</p>

So far so good. The table will expand downwards as you add more content, so a repeating background image will tile just nicely until the end of your email.

The good news is that this works in most major email clients, including Gmail. Notable exceptions are Outlook 2007 and 2010, plus Lotus Notes 6 and 7.

The CSS approach

Not wanting to keep the ever-demanding Outlook 2007 and its relation, Outlook 2010 away from the action, we turned to a crafty technique for getting background images to work in Outlook 2007. The code looks something like this:

body {
background-image: url('background_image.png');
background-repeat: repeat-y no-repeat;
background-color: #333;
margin: 0;
padding: 0;

Surprisingly enough for a CSS solution, this does the trick in Outlook 2007 et al. The main difference between this approach and using table attributes is that in some email clients, the background image will extend the entire height of the reading pane, instead of simply the height of the email. However, unless you have a fairly short email (less than the height required for the scrollbar to kick in), you won’t be able to tell the difference.

I’ve also had it pointed out that using the background attribute in the body tag works in a similar fashion. Unfortunately, it doesn’t seem to display a background image in Outlook XP. Considering you have to use some CSS anyway (see below), you might as well stick to our CSS approach.

So are you thinking what I’m thinking?

“By your powers combined!”

By using both the table attribute and CSS styles in your HTML email, you pretty much have the entire spectrum of major email clients covered. Don’t forget to set margin: 0; padding: 0; in body (as above) – otherwise your table background image won’t be flush with the image defined in your CSS styles.

And finally, if you’re really finicky, you can define a fallback color for Lotus Notes 6 & 7 by using, <body bgcolor="#333"> (where #333 is the color of your choice). If you’ve already defined a fallback background-color using CSS, then this will only display in these earlier versions of ‘Notes.

Well, that’s background images in the bag. Many thanks to Stephen for the awesome tip and staying up late to give us first-hand World Cup updates. Let us know below if you have any questions, or have been using a similar alternative!

  • Jake Holman

    Damn, you guys have discovered me long held secret!

  • Tim Anderson-Bonsor

    I’d given up on backgrounds in email – thanks very much for posting this.

  • Chris

    What does this do for the size of the email though?

  • Craig

    Thanks for posting guys.

    @chris – no more than adding any other image – what are you getting at? And technically, the size of the email isn’t affected as the images are downloaded from the server. If someone doesn’t want images, they don’t have to turn them on.

  • caleb

    But would this work if it were to be applied inside a cell with text in it?

  • Caryn

    This is awesome info. Thanks!

  • Dennis

    Funny to see the CSS solution and not the HTML one work in Outlook :)

  • Chet

    Does it matter where you place the css for the


    styles, or do you just add an inline

    <style></pre> tag and place the css it in that? I know that some email clients strip out the 
    <head>/pre> section.
  • Dean

    This is great news when you want the attribute applied to the entire background. My main hurdle is getting it to work for side borders alone. It still appears as though Outlook wont accept classes for background images, only body. Has anyone had any success with this?

  • Ros Hodgekiss

    Caleb – Unfortunately, this doesn’t seem to work as well when applied to individual table cells. In particular, Windows 07/10/Mail just won’t play nice.

  • Sudeep

    great post….

    i am not much of “table” user,but when it comes to e-mailer(specially for outlook) i always use them…

  • MG

    I almost never use tables for web pages …. but when it comes to email they solve a lot of problems. Great post ! Thanks.

  • Federico Capoano

    Nice tip.. using ugly old style HTML and CSS in email works always better.

  • Bravo Web Solutions

    The only way I’ve been able to get background images to render in email is to reference the image via url(‘http://domainname.com/imagename.gif for example. Otherwise how does the recipient reference the image; it’s not like it get’s attached automatically – right?

  • Ros Hodgekiss

    Hi Bravo, Campaign Monitor hosts any images that you upload during the campaign import process and updates your links accordingly to reflect this. So background-image: url(‘https://www.campaignmonitor.com/assets/uploads/https://www.campaignmonitor.com/assets/uploads/background_image.png’); is fine, as long as you zip up https://www.campaignmonitor.com/assets/uploads/https://www.campaignmonitor.com/assets/uploads/background_image.png and import it as well.

  • Veiko

    Hi, tried but still not working :( Outlook 2007 cleans up the body tag and marks out style tag. Outlook source below. Do you have any fix for it?

    // original html //

    <html lang=”en”>
    <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
    body &#123

    background-image:url(http://www.mydomain.com/bg.gif” bgcolor=”#ffffff” border=”0″ cellpadding=”0″ cellspacing=”0″ width=”100%”>

  • Nickolas Simard

    Great job in summing it all up for us. I’ve always used table in email designs, and I still see that this (old) technique have its uses for some email clients.

    In any cases, thanks for sharing the tests you made.

  • diane

    will an inline style work as well as attaching the css in the header?

  • David Bloomfield

    @veiko Try putting http:// in front of your image url and see if that works.

  • Edward

    Wow, I never knew you could add the background attribute directly to the table tag, i will have to try this out today.

  • Tony

    Adding images and table to your email newsletter is nice, but unfortunately the recipients spam software will still kick it out because of base 64 and being able to detect that it is an html doc

  • Dan

    It doesn’t work for me either. Even with http:// in front of the image ref.

  • Frederick

    Please provide your code, this is not working for me?

  • BrenFM

    @Veiko – another trick we’ve picked up is that some emails strip out style code in the head section. Generally we put our style declarations below the body tag (seems to be greater support for this). Dunno… might help you, might not!

  • Ros Hodgekiss

    Dan & Frederick – Check out this basic sample newsletter – hopefully the source code will give you some pointers to get it working.

    Diane – yes, it should. By default, Campaign Monitor moves your styles inline upon import of your email.

    Tony – we haven’t come across any particular spam filter issues with using this technique. It doesn’t use base64 encoding, just plain-jane HTML/CSS.

    Thank you, everyone! We’ve been loving the feedback from all of you, so keep being awesome. Happy emailing!

  • Dan

    Thanks Ros
    It seems that bg image needs to repeat-y. Without this attribute it doesn’t work. What if I want to use only one image and don’t repeat it?

  • Ros Hodgekiss

    Hi Dan, yep, that’s spot on. Unfortunately, I’ve tried using one, non-repeating image and it doesn’t seem to work. If you use background-repeat: no-repeat; the background image doesn’t display in Outlook ’07.

    So, it’s a repeating background or nothing, it seems. Or potentially, you can use a helluva big image…!

  • Dan

    Hi Ros
    I don’t really want to do massive BG image because of mobile device users. I’m trying to get to the bottom of this and I will let you know as soon as I find solution to this

  • Jess Bonde

    Great tip!
    I put all my CSS inline and I’ve also heard that I should only put in the mail what’s inside the <body> tag because clients don’t consider the <head> and <title> and all that anyway. If I use this approach do I just put the <style></style> above my html or is that bad?

    So it’s:
    MY CSS

  • Vincent

    Hi Ros, I’ve tried copy and paste the sample code but it doesn’t work for me in Outlook 07(the html email only display the background color). The background image I’m using is saved on a web server and I’m using a absolute path to link to it (e.g. http://www.dominname.com/imgs/…. I was wondering if there is any requirement for the location of the background image?

    Thanks a lot for your help!

  • Aaron

    Does the CSS only work on the body tag in 07, or can this be applied to any element (eg the table element)?


  • Ros Hodgekiss

    @Jess – A lot of email clients do have the habit of stripping <head> tags. However, Campaign Monitor moves a copy of your styles inline by default, so this isn’t such an issue. Your approach is valid, too, as is just making your styles inline when coding your email :)

    @Vincent – Very interesting. Your example should work, as the app assigns an absolute link to all images imported with your HTML email (ie. we host ’em), then uses this link in your campaigns. Could you kindly send an email with your code (including a link to your image) to support [at] campaignmonitor.com, addressed to me? I’ll certainly take a look into it.

    @Aaron – Sadly, it only seems to work with the body tag in ’07.

  • Frederick

    Hi Ros,
    I pasted your code, I gave the image the correct path
    background-image: url(https://www.campaignmonitor.com
    But it still does not work in Outlook 07.
    I am sorry to ask, and I do not mean any disrespect… but can anyone else test this and give their comments? This is a big deal if it does work.

  • Bryan Quilty

    It’s too bad this only works on the body of the email and not within nestled tables. Either way, it’s useful! Thanks, Ros!

  • Brian Thies

    As many have posted on here already, please keep in mind this is for the background “body” of the entire e-mail.

    The body tag and a 100% table are used to double up the effort of creating the tile/repeating background.

    The next level down, however, is your centered nested table containing your content. This is where incompatibilities exist, and pitchforks are raised at Microsoft.

  • James

    hi does this only work in the body tag? I can’t get it to work in a table cell.

  • James

    ah just read the comments this won’t work in table cells :(

  • Ros Hodgekiss

    Update: There’s also an alternative method that works with individual table cells. Check it out here. We’d love to hear any feedback you have regarding this!

  • Frederick

    Hi Ros, I tested their example and the background image does not show up in Outlook 03 or 07. I am having a hard time believing this has been tested. PLEASE help? I would love this to really work.

  • Ros Hodgekiss

    Hi Frederick, so both this method and Brian’s new method aren’t working for you, when tested on a desktop email client (ie. not the design & spam tests)? Hmm, you might want to check your security settings to ensure that images are being downloaded.

    As above, kindly send an email with your code (including a link to your image) to support [at] campaignmonitor.com – address it to me and I’ll certainly take a look into it. Alternately, we might be able to help you via Brian’s thread on the forums.

  • Brian Thies

    For those who had issues when using the background image fix and background colors (colors were trumping images), there’s a fix now posted on the thread mentioned by Ros.

  • ChrisYella

    Thank you very much – this solution works quite well when displaying background images in Hotmail and Live mail! Now my html emails display in Outlook (not all versions tested though…), Outlook Express, Hotmail, Windows Live, Thunderbird, and Gmail.

  • Rob Langdon

    This is a great help, much appreciated CM! :)

  • Yannick

    Just posted the fruit of an experiment with background-image on the CM forum


    Let me know what you think good people :)

  • ella

    Great stuff

  • Eugene Chechel

    How can I prevent html background attribute from repeating?

  • Balthazar Simões

    Hey Eugene! Have you checked out our bulletproof background generator here: https://backgrounds.cm/?

  • Eugene Chechel

    Hi. Yes and I see background. But I want to see it only once. Not repeating it

  • Balthazar Simões

    Have you had a look at our post here: https://www.campaignmonitor.com/blog/email-marketing/2010/12/updated-applying-a-background-image-to-html-email/? Here are the relevant bits:

    “To prevent the image from repeating, you can either match the background image dimensions to cell width and height, or replace <v:fill type=”tile” with<v:fill=”” type=”frame” to=”” resize=”” the=”” image=”” to=”” the=”” dimensions=”” defined=”” in=”” <v:rect=””>.”

    I hope that helps!

  • Syed zeeshan ahmed

    its not working in outlook desktop

  • Eugene Chechel

    Yes that helped. I had to redo markup to prevent background from repeating. Thanks

This blog provides general information and discussion about email marketing and related subjects. The content provided in this blog ("Content”), should not be construed as and is not intended to constitute financial, legal or tax advice. You should seek the advice of professionals prior to acting upon any information contained in the Content. All Content is provided strictly “as is” and we make no warranty or representation of any kind regarding the Content.
Straight to your inbox

Get the best email and digital marketing content delivered.

Join 250,000 in-the-know marketers and get the latest marketing tips, tactics, and news right in your inbox.


See why 200,000 companies worldwide love Campaign Monitor.

From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that boost the bottom line.

Get started for free