Skip to content

Instantly share code, notes, and snippets.

@johnhunter
Created August 27, 2011 14:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save johnhunter/1175458 to your computer and use it in GitHub Desktop.
Save johnhunter/1175458 to your computer and use it in GitHub Desktop.
TextMate snippet: table cell background (html email)
<!--
Don't forget to add:
<html xmlns:v="urn:schemas-microsoft-com:vml">
-->
<!--[if gte mso 9]>
<v:image xmlns:v="urn:schemas-microsoft-com:vml" style='behavior: url(#default#VML);
display: inline-block;
position: absolute;
height: ${1:100}px;
width: ${2:100}px;
top: 0;
left: 0;
border: 0;
z-index: 1;'
src="${3:image-url}"/>
<v:shape xmlns:v="urn:schemas-microsoft-com:vml" style='behavior: url(#default#VML);
display: inline-block;
position: absolute;
height: $1px;
width: $2px;
top: -5;
left: -10;
border: 0;
z-index: 2;'>
<div>
<![endif]-->
${4:All of your content that will be floating over the background image.}
<!--[if gte mso 9]>
</div>
</v:shape>
<![endif]-->
@johnhunter
Copy link
Author

TextMate snippet for adding background images to table cells for Outlook. Uses a vml hack to absolutely position elements under the content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment