【问题标题】:Background image in Outlook - unknown height?Outlook 中的背景图片 - 高度未知?
【发布时间】:2017-11-27 16:16:33
【问题描述】:

我通过以下方式设置背景图片:

<table>
<tr>
<td background="my-bg.jpg" bgcolor="#ebeae8" valign="top">
    <!--[if gte mso 9]>
    <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width: 600px;">
        <v:fill type="tile" src="my-bg.jpg" color="#ebeae8" />
             <v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
                <![endif]-->
                   <div>
                       CONTENT HERE
                    </div>
                <!--[if gte mso 9]>
            </v:textbox>
        </v:rect>
    <![endif]-->
</td>
</tr>
</table>
<table>
.....more content that gets overlayed in Outlook 2013

不幸的是,在 Outlook 2013 中,这会覆盖电子邮件下方的其他内容。通过一些测试,我认为这是由于没有在 v:rect 上设置高度。

  1. 如何在 v-rect 上设置高度,使其成为其内容的高度。

  1. 如何防止上述 td 后面有背景图片覆盖内容?

【问题讨论】:

  • 你的意思是下一个表应该覆盖第一个表吗?
  • 无叠加,下表应位于带背景的表格下方。

标签: email outlook html-email outlook-2013


【解决方案1】:

您可以在代码中设置v:rect 元素的高度:

<table>
<tr>
<td background="my-bg.jpg" bgcolor="#ebeae8" valign="top">
    <!--[if gte mso 9]>
    <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width: 600px; height:100px;">
        <v:fill type="tile" src="my-bg.jpg" color="#ebeae8" />
             <v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
                <![endif]-->
                   <div>
                       CONTENT HERE
                     </div>
                     <!--[if gte mso 9]>
                     </v:textbox>
                     </v:rect>
                     <![endif]-->
        </td>
     </tr>
     </table>
     <table>
     
     

但我认为问题可能来自图像大小,您可以为 Outlook 指定不同的图像。我遇到了这个问题,并注意到如果您使用与其余代码相同的图像 bg,平铺可以将内容下推。

【讨论】:

  • 我知道我可以指定高度 - 问题是我不知道内容的高度。
  • 你试过height: 100%吗?或者将高度指定为您认为的最大值?例如,对于 600px,它可能是 400px 或 450px。
  • 如果您有图像的直接路径,您应该能够确定高度。或者使 BG 图像比内容的可能高度长一点。
  • 我不认为你明白。 bg 应该是内容的高度——内容的高度是未知的。
  • 那就没有办法了。你不能为未知的东西编码一个特定的高度。
猜你喜欢
  • 2012-09-19
  • 2021-04-04
  • 2014-01-15
  • 1970-01-01
  • 1970-01-01
  • 2016-03-05
  • 2016-10-06
  • 1970-01-01
  • 2014-05-22
相关资源
最近更新 更多