0

I'm trying to send and email with PHP. The content of this email have a grid with two images per row. So this div has a width of 48% that I put with CSS. My problem is that I need to put other images over the main one. But some mailers doesn't support position tag of CSS.

I have tried to create a table with 48% width and put the main image as backgroun-image and in each td the images that I need, but if it doesn't respect my image scale and it shows elongated.

How can I make a table adjust to it background-image respecting their scale? Or is there any other solution?

Here is my code:

<table class="tableimage" cellspacing="0" cellpadding="0" border="0" background="image.png"style="background-size: 100% 100%;width:48%">
<tr>
  <td width="50" align="center">1</td>
  <td width="50" align="center">2</td>
  <td width="50" align="center">3</td>
</tr>
<tr>
  <td width="50" align="center">4</td>
  <td width="50" align="center">5</td>
  <td width="50" align="center">6</td>
</tr>
</table>

EDIT:

Ok, let me explain. I'm trying to send by email an image with a png logo over it. My first try was to put the image with position relative and the logo with position absolute, but not all the mailers support css position tag. So I decided to try it using tables. I have created a table with a background image and put the logo inside a td of this table. My background image needs to have a 48% width and auto heigth. How can I get my table adjust to the size of the background image?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
jgm196
  • 65
  • 1
  • 2
  • 8
  • if you use php, you can create the image/s dynamically with some libraries. Read here http://stackoverflow.com/questions/3876299/merging-two-images-with-php – keypaul May 13 '14 at 21:51
  • Your question isn't clear.. You mention a div, but no div exists in your code and overall your question just doesn't make much sense. Please rephrase the question. There are also a plethora of questions related to coding HTML emails, you can certainly find an answer rather than post a new one if it's strictly a formatting issue. – davidcondrey May 13 '14 at 22:25

0 Answers0