【问题标题】:Outlook adding whitespace below images or more paddingOutlook 在图像下方添加空格或更多填充
【发布时间】:2016-12-17 20:50:24
【问题描述】:

因此为客户制作了一份时事通讯,我现在在 Outlook 2007,2010,2013,2016 上只有一个小错误,假设其原因是这些使用 Word 作为渲染引擎。

基本上我有一个 2x2 的网格,每个项目都是 50%,所以所有项目都坐得很好,但在外观上看起来它要么在图像下方添加空白,要么在我的文本框中添加更多填充 (see screenshot)

这是该部分的 HTML:

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
  <tbody>

    <tr>
      <td width="50%" background="#8f5470" bgcolor="#8f5470" style="padding-left:45px; padding-right:45px; padding-top:20px; padding-bottom:20px;">
        <h4 style="Margin: 0; Margin-bottom: 10px; color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 27px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left; word-wrap: normal;">we take care of every detail</h4>
        <p style="Margin: 0; Margin-bottom: 10px; color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;">Everything from design and planning through to manufacturing and installation, and where required assisting you to appoint a builder for the required preparatory works.</p>
        <p style="Margin: 0; Margin-bottom: 10px; color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;">We are dedicated to making it as easy as possible for you.</p>
      </td>
      <td width="50%" class="show-for-large"><img src="http://aproposconservatories.co.uk/wp-content/themes/apropos_new/images/newsletter/detail-img.jpg" style="-ms-interpolation-mode: bicubic; clear: both; display: block; max-width: 100%; outline: none; text-decoration: none; width: auto;"></td>
    </tr>
  </tbody>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
  <tbody>
    <tr>
      <td width="50%" class="show-for-large"><img src="http://aproposconservatories.co.uk/wp-content/themes/apropos_new/images/newsletter/benefits-img.jpg" style="-ms-interpolation-mode: bicubic; clear: both; display: block; max-width: 100%; outline: none; text-decoration: none; width: auto;"></td>
      <td width="50%" background="#0599a8" bgcolor="#0599a8" style=" padding-left:45px; padding-right:45px; padding-top:20px; padding-bottom:20px;">
        <h4 style="Margin: 0; Margin-bottom: 10px; color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 27px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left; word-wrap: normal;">we can offer benefits to our clients</h4>
        <p style="Margin: 0; Margin-bottom: 10px; color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;">In conjunction with Barclays we are able to offer a number of financial solutions, helping our customers stay in control of their cash flow.</p>
        <p style="Margin: 0; Margin-bottom: 10px; color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: normal; line-height: 1.3; margin: 0; margin-bottom: 10px; padding: 0; text-align: left;">As members of the IBGCo we offer consumer protection at point of sale and throughout the ten year guarantee period. Providing total peace of mind.</p>

      </td>
    </tr>

  </tbody>
</table>

任何帮助将不胜感激。

【问题讨论】:

  • 您是否制作了响应式电子邮件或已修复?这个问题是因为您的图像高度小于小屏幕中的文字高度。
  • 你能把你的整个代码贴在小提琴里吗?
  • 这是一个 jsfiddle:jsfiddle.net/gzvfe8n3
  • 据我所知,如果您想让时事通讯适应 Outlook,则不应使用边距或填充,因为它使用旧的 html 1.0 和 css 1.0 并且不呈现这些 css 属性。

标签: html css email outlook newsletter


【解决方案1】:

我已将mso-padding-alt: 0px 45px; 添加到文本的父 td。

这是工作小提琴。 https://jsfiddle.net/6LgcnLka/

我附上了outlook 2013中输出的截图

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-25
    • 2015-11-20
    • 2011-09-21
    • 2012-05-22
    • 2017-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多