Chris Mccabe
Chris Mccabe

Reputation: 1951

background image in a email with a td

Trying to get a background image on the go for a cell of a table so I can display dynamic text over it

I tried :

<td style="background-image:url('bla...

It ain't working? Whats the best way to do this?

Upvotes: 1

Views: 11623

Answers (5)

Munish Kumar
Munish Kumar

Reputation: 130

<td background="sample.jpg" >

If you want to display an image for a particular cell then the best solution for this is:

Upvotes: 0

Grzegorz
Grzegorz

Reputation: 3608

<td background="sample.jpg"> 

is accually best solution. It's the most compatible way to fit all email clients. CSS solution will not work in Google mail for example. And that's pretty popular way of viewing emails these days.

Upvotes: 7

marapet
marapet

Reputation: 56456

Based on your tags, it looks like you are targeting gmail. Gmail works by using the background="image.jpg" attribute (at least if you apply it to a table, but td should be fine, too).

If you'd like to include other clients, too, you may use a mixed approach with the background-attribute and some css (check out this article with examples). Some clients (Lotus-...) are very difficult to cover though.

Upvotes: 0

webjunkie
webjunkie

Reputation: 1184

You could do a Base64 encode on the image (Base64 Online), and then add the string generated to the css rule. This will also add more space to the email about 33%.

Upvotes: 1

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46395

You want background image to be displayed for a particular cell of table ?

If that's the case, use this

<TD BACKGROUND="sample.jpg" >

Upvotes: 1

Related Questions