简体   繁体   English

HTML电子邮件在Gmail中失败

[英]Html email fails in Gmail

My html email fails to work in gmail. 我的HTML电子邮件无法在gmail中工作。 The tables are all stuffed up! 桌子都塞满了!

http://jsfiddle.net/8s6qA/ http://jsfiddle.net/8s6qA/

 <td><table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td class="w100" width="100" bgcolor="#000001" border="0"></td>
            <td class="w400 article-content" width="400" bgcolor="#000001" border="0" style="color:#FFFFFF !important"><span style="text-align:center;">
              <p>&nbsp;</p>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eu tempus nulla. Duis eu tellus tristique, mollis felis at, pharetra libero. Suspendisse pretium justo quis diam ullamcorper venenatis. Duis ac est est. Donec justo magna, varius eu lorem nec, varius lobortis dolor. Mauris et est mauris. Nulla facilisi. </p>
              </span></td>
            <td class="w100" width="100" bgcolor="#000001" border="0"></td>
          <tr>
            <td class="w100" width="100" bgcolor="#000001" border="0"></td>
            <td class="w400 article-content" width="400" bgcolor="#000001" border="0" style="color:#FFFFFF !important"><span style="text-align:center;">
              <p>When: <span style="color:#ef4541; text-align:center;">xxxxxx</span></p>
              <p>Time: <span style="color:#ef4541; text-align:center;">xxxxxx</span></p>
              <p>Where: <span style="color:#ef4541; text-align:center;">xxxxx.</span><br />
                <span style="color:#FFFFFF; text-align:center; font-size:12px">(xxxxx).</p>
              <p>RSVP: <span style="color:#ef4541; text-align:center;">xxxxx</span></p>
              <p>Dress code: <span style="color:#ef4541; text-align:center;">xxxxx</span></p>
              <p>&nbsp;</p>
              </span></td>
            <td class="w100" width="100" bgcolor="#000001" border="0"></td>
          </tr>
            </tr>

        </table></td>
      <table cellpaddi

这是gmail的截图

I don't know how to fix it. 我不知道该如何解决。 I'm new to HTML emails. 我是HTML电子邮件的新手。

In my experience, I've had little success in using CSS in style tags with HTML emails. 以我的经验,在HTML电子邮件中的样式标签中使用CSS的努力很少。 In fact, clients like Gmail strip out style takes entirely (take a look here for a discussion around it article ). 事实上,如Gmail客户带出风格完全需要(看看这里的周围有一个讨论的文章 )。

My suggestion is to move all of you styles to inline. 我的建议是将所有样式转换为内联样式。 It's super ugly, and it feels super hacky, but you will get better results. 这非常丑陋,而且感觉很hacky,但是您会得到更好的结果。

Campaign monitor gives a great overview for building cross client emails. Campaign Monitor为构建跨客户电子邮件提供了很好的概述。 Take a look here . 在这里看看。

On your table set a width using using the table width attribute(width="200") or a min-width in the inline style of the table. 在表格上使用表格宽度属性(width =“ 200”)或表格的内联样式中的最小宽度设置宽度。 If you establish a height as well you can ensure that it displays more accurately. 如果您还建立了高度,则可以确保它显示得更准确。

https://github.com/Ankiewicz/HTML-Email-Library-Template https://github.com/Ankiewicz/HTML-Email-Library-Template

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM