Skip to content

Instantly share code, notes, and snippets.

@Gennnji
Created December 7, 2020 09:43
Show Gist options
  • Save Gennnji/1df7ee399ee0919a633207e9a66d4ed3 to your computer and use it in GitHub Desktop.
Save Gennnji/1df7ee399ee0919a633207e9a66d4ed3 to your computer and use it in GitHub Desktop.
Bulletproof backgrounds for emails
Here is an example of bulletproof background in emails for Gmail, Windows Mail, etc. and especially for Outlook.
It works with attribute "background" of td and fallback in VML for Outlook.
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td background="https://i.imgur.com/YJOX1PC.png" bgcolor="#7bceeb" 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="tile" src="https://i.imgur.com/YJOX1PC.png" color="#7bceeb" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<div>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment