【问题标题】:Email Development - HTML电子邮件开发 - HTML
【发布时间】:2015-12-15 17:48:10
【问题描述】:

我很少使用电子邮件 HTML,但我目前正在尝试使用 HTML、CSS 制作示例电子邮件 - 但我遇到的问题是,当我在 Outlook 在线上对其进行测试时,“a's”无处不在,而我却没有不知道为什么?任何帮助表示赞赏!谢谢!


  <style media="screen">

  </style>

</head>
<body bgcolor="#efe1b0">
<!-- Full container for page -->
  <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#efe1b0">
    <tr>
      <td>
        <!-- Main email container -->
        <table class="container" width="640" align="center" cellspacing="0" cellpadding="0">

          <!-- Row 1 (Logo) -->
          <tr>
            <td valign="top" class="logo" bgcolor="#ffffff" style="padding: 10px 20px 0px 30px; border-left: 1px solid #dbc064; border-right: 1px solid #dbc064; border-top: 1px solid #dbc064;">
              <img style="margin-left: -10px;" src="images/large_logo.gif" alt="Our Vineyard" width="585" height="45" border="0">
            </td>
          </tr>

          <!-- Row 2 (Headline)-->
          <tr>
            <td valign="top" class="headline" bgcolor="#ffffff" style="padding: 15px 20px 5px 30px; border-left: 1px solid #dbc064; border-right: 1px solid #dbc064; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px;">
              <h1 style="margin: 0px 0px 15px 0px; font-weight: normal; font-size: 32px; color: #723c7f;">Main Heading Here</h1>
            </td>
          </tr>

          <!-- Row 3 (Image Banner) -->
          <tr>
            <td valign="top" bgcolor="#f5f2e5" class="banner" style="border-left: 1px solid #dbc064; border-right: 1px solid #dbc064;">
              <img src="images/banner_large.jpg" width="638" height="180" alt="Photo of Our Vineyard" />
            </td>
          </tr>

          <!-- Row 4 -->
          <tr>
            <td valign="top" bgcolor="#f5f2e5" class="content" style="padding: 30px 30px 10px 30px; border-left: 1px solid #dbc064; border-right: 1px solid #dbc064; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px; color: #654308;">
              Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam commodo justo tellus, non fringilla dolor scelerisque vel. Nam hendrerit eros quis elementum gravida. Cras faucibus accumsan erat at pellentesque. Etiam a ultricies enim, eget lacinia sem. Integer et elit orci. Morbi ac mauris sapien. Suspendisse viverra pellentesque orci, imperdiet posuere erat aliquam eu.
              <br><br>Enjoy,<br>
              <img src="images/josh.gif" width="90" height="40" alt="Joshua" />
            </td>
          </tr>

          <!-- Row 5 -->
          <tr>
            <td>

            </td>
          </tr>

          <!-- Row 6 -->
          <tr>
            <td>

            </td>
          </tr>

          <!-- Row 7 -->
          <tr>
            <td>

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

</body>
</html>

【问题讨论】:

  • 粘贴您正在使用的代码,以便我们查看。
  • 做 html 就像回到 90 年代一样 - 表格,表格,表格!但不要嵌套太多!一个很好的指南:campaignmonitor.com/dev-resources/guides/coding
  • @David Done,谢谢。
  • 如果您将代码复制并粘贴到记事本中,这些地方是否有任何特殊字符?看起来可能有无法解释的空白字符,因此它们被更改为 a
  • 作为测试,请尝试删除代码中的空白。我曾经在粘贴文本时看到这个,它会与字符编码/间距混淆

标签: css outlook position html-email email-client


【解决方案1】:

为了参考我的评论,关闭你的表格行,IE:

<tr>
        <td valign="top" class="logo" bgcolor="#ffffff" style="padding: 10px 20px 0px 30px; border-left: 1px solid #dbc064; border-right: 1px solid #dbc064; border-top: 1px solid #dbc064;">
          <img style="margin-left: -10px;" src="images/large_logo.gif" alt="Our Vineyard" width="585" height="45" border="0">
        </td>
      </tr><tr>
        <td valign="top" class="headline" bgcolor="#ffffff" style="padding: 15px 20px 5px 30px; border-left: 1px solid #dbc064; border-right: 1px solid #dbc064; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 22px;">
          <h1 style="margin: 0px 0px 15px 0px; font-weight: normal; font-size: 32px; color: #723c7f;">Main Heading Here</h1>
        </td>
      </tr><tr>
        <td valign="top" bgcolor="#f5f2e5" class="banner" style="border-left: 1px solid #dbc064; border-right: 1px solid #dbc064;">
          <img src="images/banner_large.jpg" width="638" height="180" alt="Photo of Our Vineyard" />
        </td>
      </tr>

【讨论】:

    【解决方案2】:

    另外, 1) 避免使用边距和填充。使用 td 创建垂直间距。见下文

    <td width="20">&nbps;</td>
    

    2) 使用 tr's 在部分之间创建水平间距。

    <tr><td style="line-height: 10px; font-size: 10px;">&nbsp;</td></tr>
    

    【讨论】:

      猜你喜欢
      • 2020-01-28
      • 2011-03-30
      • 2015-06-07
      • 2011-09-10
      • 2017-01-16
      • 1970-01-01
      • 1970-01-01
      • 2016-11-23
      • 2011-09-03
      相关资源
      最近更新 更多