html - 无法在 Outlook 2013 HTML 电子邮件中正确隐藏图像

标签 html outlook gmail html-email

我在 outlook 2013 中正确隐藏图像时遇到问题,即使它们被隐藏,它们也会在它们被隐藏的地方添加一行间距,使电子邮件看起来被拉伸(stretch)。这是我想要从桌面版本中隐藏的图像代码。

<tr style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;">
 <td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
  <img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
 </td>
 <td width="560" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="secondary-fullwidth">
  <img src="btn-8.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="btn-two" alt="Request A Test Drive" />
 </td>
 <td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
  <img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
 </td>
</tr>

感谢您的帮助

最佳答案

我使用以下修复程序来隐藏 Outlook 2007 及更高版本的内容:

    <!--[if !gte mso 9]><!---->
    <tr style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;">
 <td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
  <img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
 </td>
 <td width="560" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="secondary-fullwidth">
  <img src="btn-8.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="btn-two" alt="Request A Test Drive" />
 </td>
 <td width="20" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" class="spacer-width">
  <img class="spacer-width" src="spacer.gif" height="0" width="0" style="display: none; line-height: 0; font-size: 0; height: 0; padding: 0; mso-hide: all;" alt="" />
 </td>
</tr>
<!--<![endif]-->

关于html - 无法在 Outlook 2013 HTML 电子邮件中正确隐藏图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15274278/

相关文章:

javascript - 禁用滚动条

按日期进行 imap_search 的 PHP 方法

gmail - 如何使用 Schema.org 在 Gmail 主题行中添加转到操作?

c# - 想要枚举 Outlook 文件夹

用于事件预订的 Gmail 标记不起作用

html - 为什么我的文本垂直对齐而不是水平对齐?

jquery - 切换按钮显示/隐藏 Div 不断向上跳

javascript - jQuery水平滑动选项卡机制

html - Outlook 2003 从 html 邮件中删除除第一个图像之外的所有图像

vba - 电子邮件进入收件箱后触发 Outlook 脚本