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

时间:2013-03-07 14:52:03

标签: html outlook gmail html-email

我在Outlook 2013中正确隐藏图像时遇到问题,即使它们被隐藏,它们也会隐藏它们之间的间距,使电子邮件看起来很紧张。这是我想要在桌面版本中隐藏的图像上的代码。

<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>

感谢您的帮助

2 个答案:

答案 0 :(得分:1)

我使用以下修补程序隐藏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]-->

答案 1 :(得分:-1)

尝试添加可见性:隐藏;到了css。它在Outlook中有支持,我记得某个地方“新”Internet Explorer(也许我当时正在使用8个)需要正确隐藏某些内容。