Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How keep background image from repeating in Outlook 2007 and up

Tags:

outlook

vml

I'm using VML for a background image in an html email. The background repeats in MSO 12, 14, and 15, despite a "no-repeat" value in the VML object. Code below:

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

I've also tried using 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>

But then I get no background. I'll keep plugging, as I have a feeling the solution is something simple, but would appreciate any help...

like image 728
Cmaso Avatar asked Nov 30 '22 00:11

Cmaso


1 Answers

Change <v:fill type="tile" to <v:fill type="frame" and make sure that you have the rect the same size as the td. Using MSO-width-percent can be glitchy to a degree. As it would only be rendered on the desktop version, you should have no real issues declaring a preset value for this conditional code and I would recommend doing this.

like image 112
Gortonington Avatar answered May 17 '23 12:05

Gortonington