如何防止背景图像在Outlook 2007及更高版本中重复

如何防止背景图像在Outlook 2007及更高版本中重复,outlook,vml,Outlook,Vml,我在html电子邮件中使用VML作为背景图像。背景在MSO 12、14和15中重复,尽管VML对象中有“无重复”值。代码如下: <td align="center" valign="top" style="background-image: url('http://secure.sportssystems.com/eventdata/6389/images/APIInviteBackground.jpg'); background-repeat:no-repeat; -webkit-bac

我在html电子邮件中使用VML作为背景图像。背景在MSO 12、14和15中重复,尽管VML对象中有“无重复”值。代码如下:

<td align="center" valign="top" style="background-image: url('http://secure.sportssystems.com/eventdata/6389/images/APIInviteBackground.jpg'); background-repeat:no-repeat; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; background-position: top center;">
    <xsl:comment><![CDATA[[if gte mso 9]>
        <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="background-repeat: no-repeat; mso-width-percent:1000; height:775px; top: 0; left: 0; border: 0;z-index: 1">
             <v:fill type="tile" src="cid:http://.../myimage.jpg" />
    <![endif]]]></xsl:comment>

我还尝试使用v:background:

<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t" style="background-repeat: no-repeat; mso-width-percent:1000; height:775px;">
    <v:fill type="tile" src="cid:http://secure.sportssystems.com/eventdata/6389/images/APIInviteBackground.jpg" />
</v:background>


但是我没有背景。我会继续插上,因为我觉得解决方案很简单,但会很感激任何帮助…

通过在
元素中指定
大小
属性为“100%,100%”来更改
,我可以让我的图像拉伸而不重复

将以下代码放在开口
body
标签的正后方:

<body>
<div>
<!--[if gte mso 9]>
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="true">
    <v:fill type="tile" size="100%,100%" src="http://image.mail.minacsmarketing.com/lib/fe9912727d65017d75/m/1/test-bg.jpg"/>
</v:background>
<![endif]-->
    <table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr><td>
    </td></tr>
    </table>
</div><!--/end container div-->
</body>

注意:您的问题是针对Outlook 2007及更高版本的,这是有效的。此解决方案不适用于Outlook.com电子邮件,因为它们不支持VML代码。

这对我有效。我已经挣扎了几个小时,我放在表格背景中的图像在Outlook for Windows中水平拉伸,但在Outlook Online中显示正确。但是,将“瓷砖”改为“框架”效果非常神奇。谢谢百万分之一这个解决方案对我也有效。我欠你一杯啤酒!可惜你不能用掩护。仅拉伸或平铺:/@Adam:See和
aspect=“至少”
aspect=“atmost”
部分。非常感谢!当图像在VML中看起来更大时,它还帮助我解决dpi相关的问题。