Skip to content

Instantly share code, notes, and snippets.

@mov-78
Last active January 4, 2016 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mov-78/8561459 to your computer and use it in GitHub Desktop.
Save mov-78/8561459 to your computer and use it in GitHub Desktop.
a starting point for creating bullet-proof responsive HTML emails
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>|*MAIL:TITLE*|</title>
<style type="text/css">
/*
[NOTICE]
Before sending this mail:
(1) Validates markup and running tests,
if everything works fine then:
(2) Run it through a mail pre-processor
to strip out all comments(including this
one) and make all styles inline(except for
media queries - you may have to keep media
queries somewhere before processing and
then put it back as some pre-processor may
not reserve media queries, e.g: premailer).
(3) Validates markup and test again.
*/
body {
margin: 0;
min-width: 100% !important;
padding: 0;
}
.content {
border-collapse: collapse;
max-width: 600px;
width: 100%;
}
@media only screen and (min-device-width: 601px) {
.content {
width: 600px !important;
}
}
</style>
</head>
<body yahoo>
<table bgcolor="#FFFFFF" border="1" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr>
<td>
<!--[if (gte mso 9)|(IE)]>
<table align="center" border="1" cellpadding="0" cellspacing="0" width="600">
<tr>
<td>
<![endif]-->
<table align="center" border="1" cellpadding="0" cellspacing="0" class="content">
<tr>
<td>|*MAIL:BODY*|</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</body>
</html>
@mov-78
Copy link
Author

mov-78 commented Jan 25, 2014

via: 123

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