html 电子邮件中的背景图像 css - Gmail 不支持 [英] Background-image css inside an html email - Gmail does not support

查看:71
本文介绍了html 电子邮件中的背景图像 css - Gmail 不支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向我的用户发送如下所示的带有背景图像 css 的 html 正文电子邮件:

<div style='width:500px;height:1000px;background-color:black;background-image:url(http://upl0ad.org/images/mylogo.gif) 重复滚动左上角;'>我的内容

但正如下面的链接所说,谷歌不支持背景图片css!
http://www.campaignmonitor.com/css/

我该怎么办?

解决方案

您是否尝试过设置 背景 表的属性?

这是以下 Mailchimp 博客文章中详细介绍的推荐方法:HTML 电子邮件中的背景图片和 CSS.

示例(在 Gmail 中测试)

 <tr><td>电子邮件内容...</td></tr>

I want to send html body email like below with background-image css to my users :

<div style='width:500px;height:1000px;background-color:black;background-image:url(http://upl0ad.org/images/mylogo.gif) repeat scroll left top;'>
    My Content
</div>

but as the link below says google does not support background-image css!
http://www.campaignmonitor.com/css/

what can I do about that?

解决方案

Have you tried setting the background attribute of a table?

This is the recommended method detailed in the following Mailchimp blog post: Background Images and CSS in HTML Email.

Example (Tested in Gmail)

    <table background="https://www.google.com/intl/en_com/images/srpr/logo3w.png" width="275" height="95">
        <tr>
            <td>
                Email Content...
            </td>
        </tr>
    </table>

这篇关于html 电子邮件中的背景图像 css - Gmail 不支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆