【问题标题】:Html email fails in GmailGmail 中的 HTML 电子邮件失败
【发布时间】:2014-07-24 11:29:18
【问题描述】:

我的 html 电子邮件无法在 gmail 中使用。桌子都塞满了!

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

我不知道如何解决它。我是 HTML 电子邮件的新手。

【问题讨论】:

  • 将 html 电子邮件视为 90 年代风格的 html 4 过渡表格。您可以使用 css,但有被剥离的风险。如果您像以前那样写出来,您很可能会在大多数邮件客户端中按预期显示它。

标签: html html-table html-email


【解决方案1】:

根据我的经验,我在 HTML 电子邮件的样式标签中使用 CSS 几乎没有成功。事实上,像 Gmail 这样的客户完全去掉了风格(查看这里以了解有关它的讨论article)。

我的建议是将所有样式移至内联。它超级丑陋,感觉超级hacky,但你会得到更好的结果。

Campaign Monitor 为构建跨客户电子邮件提供了很好的概述。看看here

【讨论】:

    【解决方案2】:

    在表格上使用表格宽度属性(width="200")或表格内联样式中的最小宽度设置宽度。如果你也建立一个高度,你可以确保它显示得更准确。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-09
      • 1970-01-01
      • 2012-04-03
      • 1970-01-01
      • 1970-01-01
      • 2018-09-04
      • 1970-01-01
      • 2011-11-09
      相关资源
      最近更新 更多