pitzki
pitzki

Reputation: 175

HTML email background image repeating when I open in Gmail

For some reason the image is still repeating for me when I open in Gmail. (I have the enclosing statement later in the code.)

   <td style="-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;mso-table-lspace: 
0pt;mso-table-rspace: 0pt;word-break: break-word;-webkit-hyphens: none;-moz-hyphens: 
none;hyphens: none;border-collapse: collapse;background-image:${heroBackground};background- 
color:green;background-repeat:no-repeat;background-size:cover;background-position: center;" 
bgcolor="green" background="${heroBackground}" valign="top"> 

<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" 
  style="mso-width-percent:1000">
<v:fill type="frame" src="${heroBackground}" color="#7C64C3" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">

<div>
<div style="font-size: 0;line-height: 0;margin: 0;border: 0">

<![endif]--> 

Upvotes: 0

Views: 816

Answers (2)

pitzki
pitzki

Reputation: 175

It's a typo on my part. The CSS BG property is missing syntax. e.g. url('').

Upvotes: 2

Pablo C
Pablo C

Reputation: 62

Here you have this question answered: Gmail HTML email background

There are different facts when coding for email on every single CSS property. Here, as they say, could be Gmail does not recognize background-position so you should use the background shorthand property.

Upvotes: -1

Related Questions