Outlook 在 HTML 电子邮件中添加空间 [英] Outlook adding space in HTML email

查看:30
本文介绍了Outlook 在 HTML 电子邮件中添加空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个常见问题,我已经四处寻找解决方案.我遇到的一切,我都试过了.如果我还有头发,我会把它拔掉.

I know this is a common problem, I've searched high and low for a solution. Everything I've come across, I've tried. If I had any hair left I would be pulling it out.

我有一个包含一系列要点的表格.此表格的问题在于,每当我创建新行时,Outlook 都会决定在每行下方添加额外的间距,使我的表格看起来比应有的大.

I have a table that has a series of bullet points. The problem with this table is that whenever I create a new row, Outlook decides to add extra spacing below each row, making my table look larger than it should be.

<style type="text/css">
  .ExternalClass table, .ExternalClass tr, .ExternalClass td {line-height: 100%;}
</style>

<table width="400" align="left" cellpadding="0" cellspacing="0" border="0">
  <tr style="margin:0px; padding:0px;">
    <td width="10" align="right" valign="top" style="border:none; margin:0px; padding:0px;">
      <p style="margin:0px; padding:0px;">
      &bull;
      </p>
    </td>
    <td width="380" align="left" valign="top" style="border:none; margin:0px; padding:0px;">
      <p style="margin:0px; padding:0px;">
      Info next to bullet
      </p>
    </td>
  </tr>
  <tr style="margin:0px; padding:0px;">
    <td width="10" align="right" valign="top" style="border:none; margin:0px; padding:0px;">
      <p style="margin:0px; padding:0px;">
      &bull;
      </p>
    </td>
    <td width="380" align="left" valign="top" style="border:none; margin:0px; padding:0px;">
      <p style="margin:0px; padding:0px;">
      Info next to bullet
      </p>
    </td>
  </tr>
</table>

我尝试过但不起作用的事情:

Things I've tried that did not work:

border-collapse:collapse

display:block

display:inline-block

float:left

推荐答案

删除 <p> 标签,邮件客户端并不总是尊重这些样式,他们会自动添加一个额外的之后换行.

Remove the <p> tags, mail clients don't always respect styling on those and they'll automatically add an extra line break afterwards.

如果需要,您可以将

替换为 ,因为 不会带有任何免费"填充.

You can replace the <p> with a <span> if needs be, as <span> doesn't come with any 'free' padding.

这篇关于Outlook 在 HTML 电子邮件中添加空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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