VML背景图像位于Outlook的底部



我正在创建一封电子邮件,它必须在Outlook上看起来很好。在电子邮件中,我有一段文字(高度为324px(,我需要一个位于段落底部的背景图像(高度:153px(。

我现在有以下代码:

<td align="center" valign="top" background="background.png" style="background-repeat: no-repeat;background-position:bottom;background-size: contain;" height="324" bgcolor="#ffffff">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width: 620px;height: 153px;">
<v:fill type="frame" src="background.png" color="#ffffff"  />
<![endif]-->
Body Text here
<!--[if gte mso 9]>
</v:rect>
<![endif]-->
</td>

目前的问题是:

  1. 背景图像不按比例缩放。它一直延伸到段落的整个高度
  2. 我不知道该如何把它放在段落的底部

VML方面的专家能帮我吗?非常感谢!

您可能需要跳出框框思考这个问题;(

选项(A(,根据Syfer的意见创建具有所需高度的背景图像

选项(B(,将大部分内容放在VML之上,只在VML部分放几行。这样,VML部分就不会拉伸,但你仍然会得到效果,即:

<td align="center" valign="top" background="background.png" style="background-repeat: no-repeat;background-position:bottom;background-size: contain;" height="324" bgcolor="#ffffff">
<p>Body text here</p>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width: 620px;height: 153px;">
<v:fill type="frame" src="background.png" color="#ffffff"  />
<![endif]-->
Part of body Text here
<!--[if gte mso 9]>
</v:rect>
<![endif]-->
</td>

我认为应该在v:fill上使用aspect、position和origin属性。这类模拟背景:css中的中心-底部包含:

<td align="center" valign="top" background="background.png" style="background-repeat: no-repeat;background-position:bottom;background-size: contain;" height="324" bgcolor="#ffffff">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width: 620px;height: 153px;">
<v:fill origin="0,0.5" position="0,0.5" aspect="atmost" type="frame" src="background.png" color="#ffffff"  />
<![endif]-->
Body Text here
<!--[if gte mso 9]>
</v:rect>
<![endif]-->
</td>

最新更新