Most reliable way of using backround image?

I know that using a background image in html emails can be tricky, but it should be possible. Basically I would need to get it working in outlook 2003, 2007 and in gmail webmail. Here is the image of a test scenario I would like to achieve:
And here is the html code where I tried 3 different ways to include the background:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<body style="margin:0px; padding: 0px;">

<div id="reference_image">
<img src="" alt="reference image">


<div id="normal" style="background: #518E55 url( no-repeat; height: 185px; width:320px;">
<h2 style="padding-top: 135px; padding-left: 20px; color:#FFFFFF;">Just some random text</h2>


<div id="margin" style="background-color: #518E55; width:320px;">
<img src="" alt="background" height="185" width="320">
<h2 style="margin-top: -50px; padding-left: 20px; color:#FFFFFF;">Just some random text</h2>


<div id="table">
<table background="" style="background-repeat: no-repeat; height: 185px;" bgcolor="#518E55" width="320" border="0" cellspacing="0" cellpadding="0">
<h2 style="padding-top: 115px; padding-left: 20px; color:#FFFFFF">Just some random text</h2>


Can anybody help me to get this example to work in these 3 clients? And as you imagine the white text should also fall back nicely so that it will be visible if images are off.

fyredefyre fyredefyre, 7 years ago

This seems to be the topic of interest lately. Background images have limited browser support and whilst you may have a workaround to achieve your background image, you can never guarantee they'll work across all popular email clients.

Your best bet it to work with convert your background into a standard image and use tables broken into cells to assign image and text areas.

Based on your image example, I'd set everything as an image, but save a cell and set a plain black background colour. It may not look to crash hot in all scenarios, but the text and images will be visible (assuming images are loaded) straight away.

Until things change with browser support it's best not go against the flow, but work within your boundaries. - Everything Email.
Email: Skype: fyredefyre

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