开发者

background image in a email with a td

开发者 https://www.devze.com 2023-02-19 18:52 出处:网络
Trying to get a background image on the go for a cell of a table so I can display dynamic text over it

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?


<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.


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%.


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

If that's the case, use this

<TD BACKGROUND="sample.jpg" >


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.


<td background="sample.jpg" >

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号