GMail中的宽度无效

时间:2014-10-28 10:40:34

标签: html css ruby-on-rails gmail html-email

我有HTML电子邮件的设计,必须显示为


|图像' A'此处<<<<<<<<<<<的空间>>>>>> >>>>>>>>>>>>' b'此处|


<table class="wrapper">
<tr>
    <td class="header" style="padding: 15px 15px 0;">

        <table class="max-width" cellspacing="0" cellpadding="0" style="width: 100%;">
            <tr>

                <!--RB logo-->
                **<td  style="width: 93% !important;vertical-align: top;">**
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <a class="link-style" href="https://www.reportbee.com/" target="_blank">
                                    <img src="https://gallery.mailchimp.com/0135a40176b33deb024da1fea/images/d86f927a-3eef-4e8f-9dae-99753e62b0b5.png" alt="Report Bee" title="Report Bee"></a>
                            </td>
                        </tr>
                    </table>
                </td>

                <!--RB flag-->
                <td>
                    <table class="block" cellspacing="0" cellpadding="0">
                        <tr>
                            <td> <img src="https://gallery.mailchimp.com/0135a40176b33deb024da1fea/images/2cddc1b3-1e85-4759-8cb1-7e07e9a2d89c.png" alt=""></td>
                        </tr>
                    </table>
                </td>

            </tr>
        </table>
    </td>
</tr>

我试图指定包含我的第一张图片的宽度。但Gmail不接受宽度,它将我的电子邮件显示为


| image&#39; a&#39; here image&#39; b&#39; here |


我做错了什么?

3 个答案:

答案 0 :(得分:0)

如果您要发送html电子邮件,请在标题

中传递以下信息
MIME-Version: 1.0
Content-type:text/html;charset=UTF-8

主要内容是内容类型:**Content-type:text/html**

为html电子邮件传递内容类型text / html

答案 1 :(得分:0)

我之前经历过这样的问题..在网上做了大量研究之后,我开始认识样式标签,任何大多数css元素都无法在gmail和outlook中运行

所以,如果您给出td的宽度,请将其设为 td width =“”然后您可以看到效果

答案 2 :(得分:0)

当我想要将两张图片放在电子邮件的两端时,我会使用:

<td width="40" align="left"><img></td>

<td width="100%"><img></td>

<td width="40" align="right"><img></td>

由于两个图像都有固定的宽度,因此中心的间隔物100%将图像推到外面。