Table Cell background image with text over it - Outlook - Gmail

Hi,

I recently read one of the posts on here

http://www.campaignmonitor.com/blog/post/3192/add-a-background-image-to-individual-table-cells/

and also this one:

https://www.campaignmonitor.com/forums/topic/3862/view/

explaining how I could use a simple bit of code to get background images to show correctly in my email templates.

The problem being that Outlook 2007 and Gmail seem to strip out the 'background-image' code. So this fix was supposed to make the image display properly in these clients.

Here is the code I am trying...

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<style>
v:* { behavior: url(#default#VML); display: inline-block; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head><body><table width="0" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td  background="http://www.idee-emarketing.com/admin/temp/templates/3/header.jpg" width="590" height="151" >
    
    <!--[if gte vml 1]> <v:image style='width: 590px; height: 151px; position: absolute; top: 0; left: 0; border: 0; z-index: -1;' src="http://www.idee-emarketing.com/admin/temp/templates/3/header.jpg" /><![endif]-->
        
    </td>
  </tr>
</table></body>
</html>

Can anyone tell me what I'm doing wrong? The thread is full of comments saying it works but I cant see where Im going wrong?

Any help would be greatly appreciated!

Thanks,

Shaun.

JohnP JohnP, 4 years ago

try putting width="100%" and move the background="" to your <table> tag instead of the <td>.

I stripped out all the other tags, but this works for me:

<body style="background-image: url('img');">
<table width="100%" background="img">

Hope that helps

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098