Skip to content

Instantly share code, notes, and snippets.

@adueck
Created April 26, 2019 11:20
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 adueck/1b74efa6a5623dfbe5165ec1b2f74b8f to your computer and use it in GitHub Desktop.
Save adueck/1b74efa6a5623dfbe5165ec1b2f74b8f to your computer and use it in GitHub Desktop.
An example of a Foundation for Emails html file before inlining
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Title</title>
<style>
.wrapper {
width: 100%%; }
body {
width: 100%% !important;
min-width: 100%%;
-webkit-text-size-adjust: 100%%;
-ms-text-size-adjust: 100%%;
margin: 0;
Margin: 0;
padding: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box; }
img {
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
width: auto;
max-width: 100%%;
clear: both;
display: block; }
center {
width: 100%%;
min-width: 580px; }
a img {
border: none; }
p {
margin: 0 0 0 10px;
Margin: 0 0 0 10px; }
table {
border-spacing: 0;
border-collapse: collapse; }
td {
word-wrap: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
border-collapse: collapse !important; }
table, tr, td {
padding: 0;
vertical-align: top;
text-align: left; }
@media only screen {
html {
min-height: 100%%;
background: #f3f3f3; } }
table.body {
background: #f3f3f3;
height: 100%%;
width: 100%%; }
table.container {
background: #fefefe;
width: 580px;
margin: 0 auto;
Margin: 0 auto;
text-align: inherit; }
table.row {
padding: 0;
width: 100%%;
position: relative; }
table.spacer {
width: 100%%; }
table.spacer td {
mso-line-height-rule: exactly; }
table.container table.row {
display: table; }
th.columns {
margin: 0 auto;
Margin: 0 auto;
padding-left: 16px;
padding-bottom: 16px; }
th.columns .columns {
padding-left: 0 !important;
padding-right: 0 !important; }
th.columns.last {
padding-right: 16px; }
th.columns table:not(.button) {
width: 100%%; }
th.large-3 {
width: 129px;
padding-left: 8px;
padding-right: 8px; }
th.large-3.first {
padding-left: 16px; }
th.large-3.last {
padding-right: 16px; }
th.large-4 {
width: 177.33333px;
padding-left: 8px;
padding-right: 8px; }
th.large-4.first {
padding-left: 16px; }
th.large-4.last {
padding-right: 16px; }
th.large-4 center {
min-width: 145.33333px; }
th.large-5 {
width: 225.66667px;
padding-left: 8px;
padding-right: 8px; }
th.large-5.last {
padding-right: 16px; }
th.large-5 center {
min-width: 193.66667px; }
th.large-6 {
width: 274px;
padding-left: 8px;
padding-right: 8px; }
th.large-6.first {
padding-left: 16px; }
th.large-6.last {
padding-right: 16px; }
.collapse > tbody > tr > th.large-6 {
padding-right: 0;
padding-left: 0;
width: 290px; }
.collapse th.large-6.first,
.collapse th.large-6.last {
width: 298px; }
th.large-6 center {
min-width: 242px; }
.body .columns th.large-6 {
width: 50%%; }
th.large-7 {
width: 322.33333px;
padding-left: 8px;
padding-right: 8px; }
th.large-7.first {
padding-left: 16px; }
th.large-7 center {
min-width: 290.33333px; }
th.large-8 {
width: 370.66667px;
padding-left: 8px;
padding-right: 8px; }
th.large-8.first {
padding-left: 16px; }
th.large-8.last {
padding-right: 16px; }
th.large-12 {
width: 564px;
padding-left: 8px;
padding-right: 8px; }
th.large-12.first {
padding-left: 16px; }
th.large-12.last {
padding-right: 16px; }
.collapse > tbody > tr > th.large-12 {
padding-right: 0;
padding-left: 0;
width: 580px; }
.collapse th.large-12.first,
.collapse th.large-12.last {
width: 588px; }
th.large-12 center {
min-width: 532px; }
td.expander,
th.expander {
visibility: hidden;
width: 0;
padding: 0 !important; }
table.text-center,
h1.text-center,
h3.text-center,
h4.text-center,
h5.text-center,
p.text-center {
text-align: center; }
p.text-right {
text-align: right; }
@media only screen and (max-width: 596px) {
.small-float-center {
margin: 0 auto !important;
float: none !important;
text-align: center !important; } }
img.float-center {
margin: 0 auto;
Margin: 0 auto;
float: none;
text-align: center; }
table.float-center,
th.float-center {
margin: 0 auto;
Margin: 0 auto;
float: none;
text-align: center; }
body,
table.body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
td,
th,
a {
color: #0a0a0a;
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
padding: 0;
margin: 0;
Margin: 0;
text-align: left;
line-height: 1.3; }
h1,
h2,
h3,
h4,
h5,
h6 {
color: inherit;
word-wrap: normal;
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
margin-bottom: 10px;
Margin-bottom: 10px; }
h1 {
font-size: 34px; }
h2 {
font-size: 30px; }
h3 {
font-size: 28px; }
h4 {
font-size: 24px; }
h5 {
font-size: 20px; }
h6 {
font-size: 18px; }
body,
table.body,
p,
td,
th {
font-size: 16px;
line-height: 1.3; }
p {
margin-bottom: 10px;
Margin-bottom: 10px; }
p.lead {
font-size: 20px;
line-height: 1.6; }
small {
font-size: 80%%;
color: #cacaca; }
a {
color: #2199e8;
text-decoration: none; }
a:hover {
color: #147dc2; }
a:active {
color: #147dc2; }
a:visited {
color: #2199e8; }
span.preheader {
display: none !important;
visibility: hidden;
mso-hide: all !important;
font-size: 1px;
color: #f3f3f3;
line-height: 1px;
max-height: 0px;
max-width: 0px;
opacity: 0;
overflow: hidden; }
table.button {
width: auto;
margin: 0 0 16px 0;
Margin: 0 0 16px 0; }
table.button table td {
text-align: left;
color: #fefefe;
background: #2199e8;
border: 2px solid #2199e8; }
table.button table td a {
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
font-weight: bold;
color: #fefefe;
text-decoration: none;
display: inline-block;
padding: 8px 16px 8px 16px;
border: 0 solid #2199e8;
border-radius: 3px; }
table.button:hover table tr td a,
table.button:active table tr td a,
table.button table tr td a:visited,
table.button.large:hover table tr td a,
table.button.large:active table tr td a,
table.button.large table tr td a:visited {
color: #fefefe; }
table.button.large table a {
padding: 10px 20px 10px 20px;
font-size: 20px; }
table.button.expand {
width: 100%% !important; }
table.button.expand table {
width: 100%%; }
table.button.expand table a {
text-align: center;
width: 100%%;
padding-left: 0;
padding-right: 0; }
table.button.expand center {
min-width: 0; }
table.button:hover table td,
table.button:visited table td,
table.button:active table td {
background: #147dc2;
color: #fefefe; }
table.button:hover table a,
table.button:visited table a,
table.button:active table a {
border: 0 solid #147dc2; }
table.button.secondary table td {
background: #777777;
color: #fefefe;
border: 0px solid #777777; }
table.button.secondary table a {
color: #fefefe;
border: 0 solid #777777; }
table.button.secondary:hover table td {
background: #919191;
color: #fefefe; }
table.button.secondary:hover table a {
border: 0 solid #919191; }
table.button.secondary:hover table td a {
color: #fefefe; }
table.button.secondary:active table td a {
color: #fefefe; }
table.button.secondary table td a:visited {
color: #fefefe; }
table.button.success table td {
background: #3adb76;
border: 0px solid #3adb76; }
table.button.success table a {
border: 0 solid #3adb76; }
table.button.success:hover table td {
background: #23bf5d; }
table.button.success:hover table a {
border: 0 solid #23bf5d; }
table.callout {
margin-bottom: 16px;
Margin-bottom: 16px; }
th.callout-inner {
width: 100%%;
border: 1px solid #cbcbcb;
padding: 10px;
background: #fefefe; }
th.callout-inner.primary {
background: #def0fc;
border: 1px solid #444444;
color: #0a0a0a; }
th.callout-inner.secondary {
background: #ebebeb;
border: 1px solid #444444;
color: #0a0a0a; }
table.menu {
width: 580px; }
table.menu th.menu-item {
padding: 10px;
padding-right: 10px; }
table.menu th.menu-item a {
color: #2199e8; }
table.menu.vertical th.menu-item {
padding: 10px;
padding-right: 0;
display: block; }
table.menu.vertical th.menu-item a {
width: 100%%; }
table.menu.text-center a {
text-align: center; }
.menu[align="center"] {
width: auto !important; }
@media only screen and (max-width: 596px) {
table.body img {
width: auto;
height: auto; }
table.body center {
min-width: 0 !important; }
table.body .container {
width: 95%% !important; }
table.body .columns {
height: auto !important;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding-left: 16px !important;
padding-right: 16px !important; }
table.body .columns .columns {
padding-left: 0 !important;
padding-right: 0 !important; }
table.body .collapse .columns {
padding-left: 0 !important;
padding-right: 0 !important; }
th.small-6 {
display: inline-block !important;
width: 50%% !important; }
th.small-12 {
display: inline-block !important;
width: 100%% !important; }
.columns th.small-12 {
display: block !important;
width: 100%% !important; }
table.menu {
width: 100%% !important; }
table.menu td,
table.menu th {
width: auto !important;
display: inline-block !important; }
table.menu.vertical td,
table.menu.vertical th {
display: block !important; }
table.menu[align="center"] {
width: auto !important; } }
body,
html,
.body {
background: #f3f3f3 !important; }
p {
line-height: 1.6;
margin-bottom: 1em; }
.container.header {
background: #f3f3f3; }
.body-drip {
border-top: 8px solid #663399; }
.header {
background: #8a8a8a; }
.header .columns {
padding-bottom: 0; }
.header p {
color: #fff;
padding-top: 15px; }
.header .wrapper-inner {
padding: 20px; }
.header .container {
background: transparent; }
table.button.facebook table td {
background: #3B5998 !important;
border-color: #3B5998; }
table.button.twitter table td {
background: #1daced !important;
border-color: #1daced; }
table.button.google table td {
background: #DB4A39 !important;
border-color: #DB4A39; }
.wrapper.secondary {
background: #f3f3f3; }
</style>
</head>
<body>
<span class="preheader"></span>
<table class="body">
<tr>
<td class="float-center" align="center" valign="top">
<table class="container">
<tr>
<td>
<table class="row">
<tr>
<th class="columns first last">
<table>
<tr>
<th>
<table class="spacer">
<tbody>
<tr>
<td height="16px">&#xA0;</td>
</tr>
</tbody>
</table>
<div>Email Content</div>
</th>
<th class="expander"></th>
</tr>
</table>
</th>
<th class="expander"></th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div style="display:none; white-space:nowrap; font:15px courier; line-height:0;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment