Currently working on the first serious responsive html email and got totally mad that - sometimes - the email is fully responsive but other times it is just exceeding it preset boundaries within the table-td construction.
I've limited it down to the images, mainly the head image. Once the email is sent, it exceeds the borders and ruins the email. This, while all other images proceeds as normally.
But this would only be solved by hard work, however as I said it is - sometimes - fully responsive, i.e. the head image as well.
To get it to be responsive as intended, using mac and apple mail, I open the .html document in browser and presses cmd+I; this before all the images have loaded. Basically just showing border, background color and text. If the cmd+I command would be to slow, i.e. even one image loaded, the responsiveness gets wacky again.
Fun fact (not so much): if done properly, i.e. fast as described, the Apple Mail client doesn't show the "attachment" paperclip in inbox but does in preview, large window.
Providing html as well as css for the first three (and 3 biggest) images as well for generic for this area. Why would the header image act this way? Understood the guide as the width="100%" would override the set width.
Basically followed guide from tutsplus.com with simple modifications (bg-color, border, sizes etc)
body {
margin: 0 !important;
padding: 0;
background-color: #f9f9f9;
}
table {
border-spacing: 0;
font-family: sans-serif;
color: #333333;
}
td {
padding: 0;
}
img {
border: 0;
}
div[style*="margin: 16px 0"] {
margin: 0 !important;
}
.wrapper {
width: 100%;
table-layout: fixed;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
background-color: #f9f9f9;
}
.webkit {
max-width: 602px;
margin: 0 auto;
padding-top: 20px;
padding-bottom: 30px;
}
.outer {
Margin: 0 auto;
width: 100%;
max-width: 602px;
border: 1px solid #d3d3d3;
background-color: #ffffff;
}
.full-width-image img {
width: 100%;
max-width: 600px;
height: auto;
}
.inner {
padding: 10px;
}
p {
Margin: 0;
}
a {
color: #ee6a56;
text-decoration: underline;
}
.webversion {
background-color: #d3d3d3;
text-align: center;
font-size: 10px;
padding-top: 3px;
padding-bottom: 3px;
}
.h1 {
font-size: 21px;
font-weight: bold;
Margin-bottom: 18px;
}
.contents {
width: 100%;
}
.headline {
width: 100%;
max-width: 600px;
text-align: left;
}
.one-column .contents {
text-align: left;
}
.one-column .p {
font-size: 14px;
Margin-bottom: 10px;
}
#media screen and (max-width: 400px) {
.two-column .column,
.three-column .column {
max-width: 100% !important;
}
.two-column img {
max-width: 100% !important;
}
.three-column img {
max-width: 50% !important;
}
}
#media screen and (min-windth: 401px) and (max-width: 620px) {
.three-column .column {
max-width: 33% !important;
}
.two-column column {
max-width: 50% !important;
}
}
<body style="margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;background-color:#f9f9f9;">
<center class="wrapper" style="width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;background-color:#f9f9f9;">
<div class="webkit" style="max-width:602px;margin-top:0;margin-bottom:0;margin-right:auto;margin-left:auto;padding-top:20px;padding-bottom:30px;">
<!--[if (gte mso 9)|(IE)]>
<table width="602" align="center" style="border-spacing:0;font-family:sans-serif;color:#333333;" >
<tr>
<td style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<![endif]-->
<table class="outer" align="center" style="border-spacing:0;font-family:sans-serif;color:#333333;Margin:0 auto;width:100%;max-width:602px;border-width:1px;border-style:solid;border-color:#d3d3d3;background-color:#ffffff;">
<tr>
<td class="webversion" style="padding-right:0;padding-left:0;background-color:#d3d3d3;text-align:center;font-size:10px;padding-top:3px;padding-bottom:3px;">
READ IN BROWSER
</td>
</tr>
<tr>
<td class="full-width-image" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
<img src="IMGLINK/huvud.png" alt="" style="border-width:0;width:100%;max-width:600px;height:auto;" />
</td>
</tr>
<tr>
<td class="one-column" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
<table width="100%" style="border-spacing:0;font-family:sans-serif;color:#333333;">
<tr>
<td class="inner contents" style="padding-top:10px;padding-bottom:10px;padding-right:10px;padding-left:10px;width:100%;text-align:left;">
<p class="h1" style="Margin:0;font-size:21px;font-weight:bold;Margin-bottom:18px;text-align:center;">HEADLINE HERE</p>
<p class="p" style="Margin:0;font-size:14px;Margin-bottom:10px;">TEXT GOES HERE</p>
<p class="p" style="Margin:0;font-size:14px;Margin-bottom:10px;">TEXT GOES HERE</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="two-column" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;text-align:center;font-size:0;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" style="border-spacing:0;font-family:sans-serif;color:#333333;" >
<tr>
<td width="50%" valign="top" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<![endif]-->
<div class="column" style="width:100%;max-width:300px;display:inline-block;vertical-align:top;">
<table width="100%" style="border-spacing:0;font-family:sans-serif;color:#333333;">
<tr>
<td class="inner" style="padding-top:10px;padding-bottom:10px;padding-right:10px;padding-left:10px;">
<table class="contents" style="border-spacing:0;font-family:sans-serif;color:#333333;width:100%;font-size:14px;text-align:left;">
<tr>
<td style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
<img src="IMGLINK/utb.png" width="280" alt="" style="border-width:0;width:100%;max-width:280px;height:auto;" />
</td>
</tr>
<tr>
<td class="text" style="padding-bottom:0;padding-right:0;padding-left:0;padding-top:10px;">TEXT GOES HERE
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
<td width="50%" valign="top" style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
<![endif]-->
<div class="column" style="width:100%;max-width:300px;display:inline-block;vertical-align:top;">
<table width="100%" style="border-spacing:0;font-family:sans-serif;color:#333333;">
<tr>
<td class="inner" style="padding-top:10px;padding-bottom:10px;padding-right:10px;padding-left:10px;">
<table class="contents" style="border-spacing:0;font-family:sans-serif;color:#333333;width:100%;font-size:14px;text-align:left;">
<tr>
<td style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;">
<img src="IMGLINK/erf.png" width="280" alt="" style="border-width:0;width:100%;max-width:280px;height:auto;" />
</td>
</tr>
<tr>
<td class="text" style="padding-bottom:0;padding-right:0;padding-left:0;padding-top:10px;"> Text goes here
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
Related
I have a simple 2 column layouts using a hybrid fluid design. I want the columns to stack on top of each other on mobile screens. I have a two-columns class table that wraps around my column class tables. On my column class tables i have style="display: inline-block; vertical-align: top; width: 100%; max-width: 300px; border-spacing:0; background-color: #D93644;". This table holds my img tag on this one column. My other column holds the writing content.
This section alone should be should be responsive already due to the inline-block, width and max width styling but it doesn't stack on top of each other on smaller screens and I cannot for the life of me figure out why and its probably something so so simple. Really need help with this.
<!-- START 1ST TWO COLUMN -->
<tr>
<td>
<table width="100%" style="border-spacing: 0;" role="presentation">
<tr>
<td class="two-columns" style="padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; font-size: 0; text-align: center;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" style="border-spacing:0;" role="presentation">
<tr>
<td width="300" valign="top" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;">
<![endif]-->
<table class="column" role="presentation" style="display: inline-block; vertical-align: top; width: 100%; max-width: 300px; border-spacing:0; background-color: #D93644;">
<tr>
<td class="padding" style="background-color: #D93644; padding-top: 0; padding-right: 0px; padding-bottom: 0; padding-left: 0px; font-size: 0;">
<table class="content" role="presentation" style="border-spacing: 0; text-align: left;">
<tr>
<td style="background-color: #D93644;">
<img class="two-col-img" width="280" style="max-width: 280px;" height="215.7" src="http://ibb.co.com/images/c81e0cd1b8b486f30644ee03f4a1988e.png" alt="airplane" border="0" title="airplane with red background">
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td><td width="300" valign="middle" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;">
<![endif]-->
<table class="column" role="presentation" style="display: inline-block; vertical-align: top; width: 100%; border-spacing:0; max-width: 300px;" >
<tr>
<td class="padding" style="padding-top: 0; padding-right: 15px; padding-bottom: 0; padding-left: 15px; font-size: 0;">
<table class="content" role="presentation" style="border-spacing: 0; text-align: left;">
<tr>
<td>
<p style="font-size: 20px; font-weight: bold; color: #808080;">We Can Give
Your Career Wings</p>
<p style="font-size: 12px; color: #808080;">Ascent Aviation Services hold one of only two Class IV CFR Part 145 license that allows us to specialize in the operation of every aspect of aircraft maintenance (Narrow and wide body, small to large, regional to long-haul).</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
<!-- END 1ST TWO COLUMN -->
I've created an email template which is rendering incorrectly on Outlook Desktop for Windows (2016, 2019).
The entire layout is a single table, with different parts of the email taking up a row (<tr>).
I have two nested tables, each in their own <tr>, with the exact same markup. When I tested it out on Litmus, the second table is narrower than the first.
How the email is rendered:
The markup:
<!DOCTYPE html>
<html lang="">
<style>
body {
padding: 20px;
font-family: Arial, Helvetica, sans-serif;
}
p {
margin: 0;
}
center {
padding: 20px;
background-color: lightyellow;
border: .1px solid gray;
}
center p {
margin: 5px 0;
}
.red {
color: red;
}
.align-center {
text-align: center;
}
.align-end {
text-align: end;
}
.dataTableContainer {
width: 100%;
text-align: left;
}
.dataTable {
width: 100%;
font-size: 14px;
border-collapse: collapse;
border: 0.5px solid gray;
}
.dataTable th, .dataTable td {
text-align: left;
border: 0.1px solid gray;
padding: 8px 5px;
}
.dataTable tr {
font-size: 14px;
mso-line-height-rule: exactly;
line-height: 90%;
}
.dataTable tr:nth-of-type(even) {
background-color: #f2f2f2;
}
.dataTable thead tr th {
border-bottom: 2px solid gray;
}
.dataTable thead tr {
background-color: #f2f2f2;
}
.footerCell {
text-align: center;
}
.brand {
font-size: 12px;
letter-spacing: 5px;
}
.main_brand {
font-size: 18px;
font-weight: bold;
font-style: italic;
letter-spacing: 1.8px;
}
.main_brand span {
font-size: 15px;
font-weight: initial;
}
</style>
<body>
<table width="100%">
<tr width="100%">
<td>
<p>Dear Customer,</p>
</td>
</tr>
<tr width="100%" align="center">
<td height="13" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
<tr width="100%" align="center">
<td>
<center>
<p class="red">
<b>YOU HAVE ACCOUNTS WHICH ARE PAST DUE</b>
</p>
<p>The below orders are scheduled to ship in the next few days and are</p>
<p class="red">
<b>AT RISK DUE TO CUSTOMER PAST DUE BALANCE</b>
</p>
<p>
In order to avoid delays, please collect payment ASAP. These orders will not be released until payment is received
</p>
<p>
Click the link below to view the customer statement
</p>
</center>
</td>
</tr>
<tr width="100%" align="center">
<td height="13" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
<tr width="100%" align="center">
<td class='dataTableContainer'>
<table cellpadding="0" cellspacing="0" class="dataTable" style="width:100%;">
<thead>
<tr>
<th><b>Order #</b></th>
<th><b>Status</b></th>
<th><b>Customer Name</b></th>
<th><b>Req Ship Date</b></th>
<th><b>Account Due</b></th>
<th><b>Account Past Due</b></th>
<th><b>Statement URL</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr width="100%" align="center">
<td height="13" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
<tr width="100%" align="center">
<td class='dataTableContainer'>
<table cellpadding="0" cellspacing="0" class="dataTable" style="width:100%;">
<thead>
<tr>
<th><b>Order #</b></th>
<th><b>Status</b></th>
<th><b>Customer Name</b></th>
<th><b>Req Ship Date</b></th>
<th><b>Account Due</b></th>
<th><b>Account Past Due</b></th>
<th><b>Statement URL</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
<tr>
<td>141926275</td>
<td>Partially Shipped</td>
<td>Adam Smith</td>
<td>2021-10-22</td>
<td class="align-end">$471.56</td>
<td class="align-end">$471.57</td>
<td>View Statement</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</body>
</html>
Through trial and error I found the incriminating line of CSS.
body {
padding: 20px;
}
padding on the body was causing the second table to get narrower than the first. Replacing padding with margin did the trick.
I still have no idea why padding is causing trouble.
I am new to email designing. I've an image, some text and a button in a row. When viewed on a mobile device, the image has to be static and the button need to come below the text. So the Image and the text + button has to be side by side. I've used divs and nested divs. Its working as expected on Mobile device. However, the layout is breaking on some web based mail clients such as AOL, Yahoo and Gmail. Working fine on comcast and outlook web. Not sure what I am doing wrong. Please help.
Correctly rendered on comcast web.
Incorrectly rendered on Yahoo web based mail.
Here is the code I've used :
#media screen and (max-width: 480px) {
/* What it does: Forces table cells into full-width rows. */
.stack-column,
.stack-column-center {
display: block !important;
width: 100% !important;
max-width: 100% !important;
direction: ltr !important;
}
/* What it does: Forces table cells into 1/3-width rows. */
.stack-column-half,
.stack-column-center-half {
display: inline-block !important;
width: 140px !important;
max-width: 140px !important;
direction: ltr !important;
}
/* What it does: Forces table cells into 2/3-width rows. */
.stack-column-2half,
.stack-column-center-2half {
display: inline-block !important;
width: 190px !important;
max-width: 190px !important;
direction: ltr !important;
}
/* And center justify these ones. */
.stack-column-center {
text-align: center !important;
}
/* What it does: Generic utility class for centering. Useful for images, buttons, and nested tables. */
.center-on-narrow {
text-align: center !important;
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
float: none !important;
}
table.center-on-narrow {
display: inline-block !important;
}
/* What it does: Adjust typography on small screens to improve readability */
.email-container p {
font-size: 17px !important;
}
<tr>
<!-- dir=ltr is where the magic happens. This can be changed to dir=rtl to swap the alignment on wide while maintaining stack order on narrow. -->
<td dir="ltr" height="100%" valign="top" width="100%" style="font-size:0; padding: 10px 0; background-color: #ffffff;">
<!--[if mso]>
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="600" style="width: 600px;">
<tr>
<td valign="top" width="200" style="width: 200px;">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; max-width: 200px; min-width:80px; vertical-align:top; width:100%;" class="stack-column-half">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td dir="ltr" style="padding: 0 10px 10px 10px;">
<img src="https://aishvaryarastogi.worldsecuresystems.com/waze-newsletter-images/Waze_Newsletter_Modules_Desktop_22.png" width="180" height="" border="0" alt="alt_text" class="center-on-narrow" style="width: 100%; max-width: 180px; height: auto; background: #dddddd; font-family: sans-serif; font-size: 15px; line-height: 15px; color: #555555; border-radius: 10px;">
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
<td valign="top" width="400" style="width: 400px;">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; max-width: 400px; min-width:160px; vertical-align:top; padding-top: 40px; " class="stack-column-2half mobile-padding1">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td dir="ltr" style="font-family:'Open Sans', Arial, sans-serif; font-size: 15px; line-height: 20px; color: #555555; padding: 10px 0px 0; text-align: left;" class="center-on-narrow fallback-text mobile-padding1">
<!--[if mso]>
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="400">
<tr>
<td valign="middle" width="200">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; width:100%; min-width:80px; max-width:200px; vertical-align:top; padding: 0 0px;" class="stack-column" align="left">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="padding: 0 20px;" class="mobile-padding1">
<h2 style="margin: 0 0 10px 0; font-family:'Open Sans', Arial, sans-serif; font-size: 15px; line-height: 18px; color: #333333; font-weight: bold;">John Smith</h2>
<p style="margin: 0 0 10px 0;">Title, title</p>
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
<td valign="middle" width="200">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; width:100%; min-width:80px; max-width:200px; vertical-align:top; padding-top:0 0px; " class="stack-column mobile-padding1">
<!-- Button : BEGIN -->
<!--[if mso]>
<v:roundrect xmlns_v="urn:schemas-microsoft-com:vml" xmlns_w="urn:schemas-microsoft-com:office:word" href="https://google.com/" style="height:45px;v-text-anchor:middle;width:150px;" arcsize="50%" stroke="false" fillcolor="#32C2EE">
<w:anchorlock/>
<center style="color:#333333;font-family:'Open Sans', Arial,sans-serif;font-size:15px;">Contact</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]> <!-->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" style="float:none;" align="left">
<tr>
<td class="button-td button-td-primary" style="border-radius: 30px; background: #ffffff;">
<a class="button-a button-a-primary fallback-text" href="https://google.com/" style="background: #32C2EE; border: 0px solid #000000; font-family:'Open Sans', Arial, sans-serif; font-size: 15px; font-weight: bold; line-height: 15px; text-decoration: none; padding: 18px 55px; color: #333333; display: block; border-radius: 30px;">Contact</a>
</td>
</tr>
</table>
<!-- <![endif]-->
<!-- Button : END -->
</div>
<!--[if mso]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<!-- Thumbnail Left, Text Right : END -->
I had a play with your code and it seems you are missing width:100%; on the following line:
<div style="display:inline-block; margin: 0 -1px; max-width: 400px; min-width:160px; vertical-align:top; padding-top: 40px;" class="stack-column-2half mobile-padding1">
Once added, the contact link went back into the same line as John Smith and Title, title.
You can try the code below to see if it works for you. I had to add table codes around the table rows to get the rendering to work.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<!-- dir=ltr is where the magic happens. This can be changed to dir=rtl to swap the alignment on wide while maintaining stack order on narrow. -->
<td dir="ltr" height="100%" valign="top" width="100%" style="font-size:0; padding: 10px 0; background-color: #ffffff;">
<!--[if mso]>
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="600" style="width: 600px;">
<tr>
<td valign="top" width="200" style="width: 200px;">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; max-width: 200px; min-width:80px; vertical-align:top; width:100%;" class="stack-column-half">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td dir="ltr" style="padding: 0 10px 10px 10px;">
<img src="https://aishvaryarastogi.worldsecuresystems.com/waze-newsletter-images/Waze_Newsletter_Modules_Desktop_22.png" width="180" height="" border="0" alt="alt_text" class="center-on-narrow" style="width: 100%; max-width: 180px; height: auto; background: #dddddd; font-family: sans-serif; font-size: 15px; line-height: 15px; color: #555555; border-radius: 10px;">
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
<td valign="top" width="400" style="width: 400px;">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; max-width: 400px; min-width:160px; vertical-align:top; padding-top: 40px;width:100%;" class="stack-column-2half mobile-padding1">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td dir="ltr" style="font-family:'Open Sans', Arial, sans-serif; font-size: 15px; line-height: 20px; color: #555555; padding: 10px 0px 0; text-align: left;" class="center-on-narrow fallback-text mobile-padding1">
<!--[if mso]>
<table role="presentation" border="0" cellspacing="0" cellpadding="0" width="400">
<tr>
<td valign="middle" width="200">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; width:100%; min-width:80px; max-width:200px; vertical-align:top; padding: 0 0px;" class="stack-column" align="left">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="padding: 0 20px;" class="mobile-padding1">
<h2 style="margin: 0 0 10px 0; font-family:'Open Sans', Arial, sans-serif; font-size: 15px; line-height: 18px; color: #333333; font-weight: bold;">John Smith</h2>
<p style="margin: 0 0 10px 0;">Title, title</p>
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
<td valign="middle" width="200">
<![endif]-->
<div style="display:inline-block; margin: 0 -1px; width:100%; min-width:80px; max-width:200px; vertical-align:top; padding-top:0 0px; " class="stack-column mobile-padding1">
<!-- Button : BEGIN -->
<!--[if mso]>
<v:roundrect xmlns_v="urn:schemas-microsoft-com:vml" xmlns_w="urn:schemas-microsoft-com:office:word" href="https://google.com/" style="height:45px;v-text-anchor:middle;width:150px;" arcsize="50%" stroke="false" fillcolor="#32C2EE">
<w:anchorlock/>
<center style="color:#333333;font-family:'Open Sans', Arial,sans-serif;font-size:15px;">Contact</center>
</v:roundrect>
<![endif]-->
<!--[if !mso]> <!-->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" style="float:none;" align="left">
<tr>
<td class="button-td button-td-primary" style="border-radius: 30px; background: #ffffff;">
<a class="button-a button-a-primary fallback-text" href="https://google.com/" style="background: #32C2EE; border: 0px solid #000000; font-family:'Open Sans', Arial, sans-serif; font-size: 15px; font-weight: bold; line-height: 15px; text-decoration: none; padding: 18px 55px; color: #333333; display: block; border-radius: 30px;">Contact</a>
</td>
</tr>
</table>
<!-- <![endif]-->
<!-- Button : END -->
</div>
<!--[if mso]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<!-- Thumbnail Left, Text Right : END -->
</tbody>
</table>
Outlook 2016 is adding space between table rows in HTML email. I can't find a fix that works. Blue section on top should be one bar, not have the white gaps. Gray section on bottom should also be one footer section, not have the two white gaps in it.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
<title>Learn how to improve employee retention by over 40%!</title> <!-- The title tag shows in email notifications, like Android 4.4. -->
<!-- Web Font / #font-face : BEGIN -->
<!-- Desktop Outlook chokes on web font references and defaults to Times New Roman, so we force a safe fallback font. -->
<!--[if mso]>
<style>
* {
font-family: sans-serif !important;
}
</style>
<![endif]-->
<!-- All other clients get the webfont reference; some will render the font and others will silently fail to the fallbacks. More on that here: http://stylecampaign.com/blog/2015/02/webfont-support-in-email/ -->
<!--[if !mso]><!-->
<link href='<link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css' />
<!--<![endif]-->
<!-- Web Font / #font-face : END -->
<!-- CSS Reset -->
<style>
/* What it does: Remove spaces around the email design added by some email clients. */
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
html,
body {
margin: 0 auto !important;
padding: 0 !important;
height: 100% !important;
width: 100% !important;
}
/* What it does: Stops email clients resizing small text. */
* {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
/* What is does: Centers email on Android 4.4 */
div[style*="margin: 16px 0"] {
margin:0 !important;
}
/* What it does: Stops Outlook from adding extra spacing to tables. */
table,
td {
mso-table-lspace: 0pt !important;
mso-table-rspace: 0pt !important;
}
/* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */
table {
border-spacing: 0 !important;
border-collapse: collapse !important;
table-layout: fixed !important;
margin: 0 auto !important;
}
table table table {
table-layout: auto;
}
/* What it does: Uses a better rendering method when resizing images in IE. */
img {
-ms-interpolation-mode:bicubic;
}
/* What it does: A work-around for iOS meddling in triggered links. */
*[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
}
/* What it does: A work-around for Gmail meddling in triggered links. */
.x-gmail-data-detectors,
.x-gmail-data-detectors *,
.aBn {
border-bottom: 0 !important;
cursor: default !important;
}
/* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
.a6S {
display: none !important;
opacity: 0.01 !important;
}
/* If the above doesn't work, add a .g-img class to any image in question. */
img.g-img + div {
display:none !important;
}
/* What it does: Prevents underlining the button text in Windows 10 */
.button-link {
text-decoration: none !important;
}
h1 {
overflow: hidden;
text-align: center;
}
h2:before,
h2:after {
background-color: #777777;
content: "";
display: inline-block;
height: 1px;
position: relative;
vertical-align: middle;
width: 50%;
}
h2:before {
right: 0.8em;
margin-left: -50%;
}
h2:after {
left: 0.8em;
margin-right: -50%;
}
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
/* Create one of these media queries for each additional viewport size you'd like to fix */
/* Thanks to Eric Lepetit #ericlepetitsf) for help troubleshooting */
#media only screen and (min-device-width: 375px) and (max-device-width: 413px) { /* iPhone 6 and 6+ */
.email-container {
min-width: 375px !important;
}
}
#media only screen and (max-width: 600px){
.hero-img {
height:auto !important;
max-width:600px !important;
width: 100% !important;
}
}
</style>
<!-- Progressive Enhancements -->
<style>
/* What it does: Hover styles for buttons */
.button-td,
.button-a {
transition: all 100ms ease-in;
}
.button-td:hover,
.button-a:hover {
background: #ffd541 !important;
border-color: #ffd541 !important;
}
</style>
</head>
<body padding="0" width="100%" bgcolor="#ffffff" style="padding: 0; margin: 0; mso-line-height-rule: exactly;">
<center style="width: 100%; background: #ffffff; text-align: center; display: inline-block;"><!-- Visually Hidden Preheader Text : BEGIN -->
<div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;">Hidden text</div>
<!-- Visually Hidden Preheader Text : END --><!--
Set the email width. Defined in two places:
1. max-width for all clients except Desktop Windows Outlook, allowing the email to squish on narrow but never go wider than 600px.
2. MSO tags for Desktop Windows Outlook enforce a 600px width.
-->
<div class="email-container" style="max-width: 600px; margin: auto;"><!--[if mso]>
<table role="presentation" aria-hidden="true" cellspacing="0" cellpadding="0" border="0" width="600" align="center">
<tr>
<td>
<![endif]--><!-- Email Header : BEGIN -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%"><tr><td height="33" bgcolor="#0072bc" style="font-size: 0; line-height: 0;" class=""> </td> </tr><tr><td bgcolor="#0072bc" align="center" class=""><img alt="companyname logo" src="http://www2.companynameweb.com/l/50342/2017-04-10/8frt4b/50342/155397/companyname_logo_lockup_white.png" aria-hidden="true" border="0" height="54" style="border-spacing: 0; min-height: 54px;"></td></tr><tr><td height="33" bgcolor="#0072bc" style="font-size: 0; line-height: 0;" class=""> </td></tr></table>
<!-- Email Header : END --><!-- Email Body : BEGIN -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%">
<tr>
<td align="left" height="5" style="font-family: sans-serif; font-size:1px; mso-line-height-rule: exactly; line-height:100%;" valign="top"> </td>
</tr>
<!-- Hero Image, Flush : BEGIN -->
<tr>
<td style="background: #ffffff" class=""><img alt="" aria-hidden="true" border="0" class="hero-img" src="http://www2.companynameweb.com/l/50342/2017-04-10/8frt4d/50342/155399/replaced_informed_employees.jpg" style="height: auto; background: #ffffff; border-width: 0px; width: 600px; line-height: 0px; color: #ffffff; max-width: 600px;" width="600"></td>
</tr>
<!-- Hero Image, Flush : END --><!-- 1 Column Text + Button : BEGIN -->
<tr>
<td height="53" style="font-size: 0; line-height: 0; min-height: 53px;" class=""> </td>
</tr>
<tr>
<td class="stack-column-center" style="font-family: 'Lato', sans-serif; line-height: 1.4em; color: #777777; text-align: center; padding: 0px 30px 0px 30px;" width="100%"><span style="color:#0072bc; font-size:18px;"><strong>It’s simple:</strong></span> lorem ipsum.<br>
<br>
lorem ipsum<em>replaceds</em>.</td>
</tr>
<tr>
<td height="40" style="font-size: 0; line-height: 0; min-height: 40px;" class=""> </td>
</tr>
</table>
<!-- Button : Begin -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="margin: auto;">
<tr>
<td class="button-td" pardot-data="link-underline:none !important;" style="border-radius: 12px; background: #FFC220; text-align: center; text-decoration: none !important;"><a class="button-a" href="http://www.companynameweb.com/" style="background: rgb(255, 194, 32); border: 15px solid rgb(255, 194, 32); font-family: sans-serif; font-size: 16px; letter-spacing: 1.5px; line-height: 1.1; text-align: center; display: block; border-radius: 4px; font-weight: bold; text-decoration: none !important;"><span class="button-link" style="color:#0072BC; text-transform: uppercase; text-decoration: none !important;"> SEE HOW IT WORKS </span></a></td>
</tr>
</table>
<!-- Button : END --><!-- Social : Begin -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" width="90%">
<tr>
<td height="50" style="font-size: 0; line-height: 0; min-height: 50px;" class=""> </td>
</tr>
<tr>
<td align="center" class="stack-column-center" style="font-family: sans-serif; line-height: 20px; color: #777777; padding: 0px 20px 0px 20px; overflow: hidden;">
<h2 style="font-size: 13px; text-transform: uppercase; text-align: center;">Follow us</h2>
</td>
</tr>
<tr>
<td height="40" style="font-size: 0; line-height: 0; min-height: 40px;" class=""> </td>
</tr>
<tr>
<td align="center" class=""><!--[if (gte mso 9)|(IE)]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td align="center" valign="top" width="600">
<![endif]--></td>
</tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="max-width:600px;" width="100%">
<tr>
<td align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="LinkedIn social icon" aria-hidden="true" height="29" src=".png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="YouTube social icon" aria-hidden="true" height="29" src=".png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="Facebook social icon" aria-hidden="true" height="29" src="png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="Twitter social icon" aria-hidden="true" height="29" src=".png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="40" style="font-size: 0; line-height: 0; min-height: 40px;" class=""> </td>
</tr>
</table>
<!-- Social : END -->
<!-- Email Footer : Begin -->
<table align="center" bgolor="#e1e1e1" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:#e1e1e1; border-spacing: 0; max-width: 600px;" width="100%">
<tr>
<td height="39" style="border-spacing: 0; line-height: 0; max-height: 39px; min-height: 39px;" class=""> </td>
</tr>
<tr>
<td class="x-gmail-data-detectors" style="padding: 0px 10px 0px 10px; width: 100%; font-size: 8px; font-family: sans-serif; line-height: 11px; text-align: center; color: #2e2e2e;"><webversion style="color:#2e2e2e; text-decoration:underline; font-weight: bold;">View as a Web Page</webversion><br><br>
© Copyright 2017 <span style="font-weight: bolder;">companyname</span><br>
#companynameweb.com | phone<br>
<span style="font-weight: bolder;">companyname</span> Headquarters | address<br><br>
Click here to unsubscribe</td>
</tr>
<tr>
<td height="39" style="border-spacing: 0; line-height: 0; max-height: 39px; min-height: 39px;" class=""> </td>
</tr>
</table>
<!-- Email Footer : END --><!--[if mso]>
</td>
</tr>
</table>
<![endif]--></div>
</center>
</body>
</html>
I fixed up issues picked by #flexlearn and add in some more code for different supported clients.
Basically these are the changes that i did:
Added display block
removed max and min height on table td
fixed font size and line height to 0px
Also you had two hrefs for the google font (now code looks better in dreamweaver)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
<title>Learn how to improve employee retention by over 40%!</title> <!-- The title tag shows in email notifications, like Android 4.4. -->
<!-- Web Font / #font-face : BEGIN -->
<!-- Desktop Outlook chokes on web font references and defaults to Times New Roman, so we force a safe fallback font. -->
<!--[if mso]>
<style>
* {
font-family: sans-serif !important;
}
</style>
<![endif]-->
<!-- All other clients get the webfont reference; some will render the font and others will silently fail to the fallbacks. More on that here: http://stylecampaign.com/blog/2015/02/webfont-support-in-email/ -->
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Lato:400,700" rel="stylesheet" type="text/css" />
<!--<![endif]-->
<!-- Web Font / #font-face : END -->
<!-- CSS Reset -->
<style>
/* What it does: Remove spaces around the email design added by some email clients. */
/* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
html,
body {
margin: 0 auto !important;
padding: 0 !important;
height: 100% !important;
width: 100% !important;
}
/* What it does: Stops email clients resizing small text. */
* {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
/* What is does: Centers email on Android 4.4 */
div[style*="margin: 16px 0"] {
margin:0 !important;
}
/* What it does: Stops Outlook from adding extra spacing to tables. */
table,
td {
mso-table-lspace: 0pt !important;
mso-table-rspace: 0pt !important;
}
/* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */
table {
border-spacing: 0 !important;
border-collapse: collapse !important;
table-layout: fixed !important;
margin: 0 auto !important;
}
table table table {
table-layout: auto;
}
/* What it does: Uses a better rendering method when resizing images in IE. */
img {
-ms-interpolation-mode:bicubic;
}
/* What it does: A work-around for iOS meddling in triggered links. */
*[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
}
/* What it does: A work-around for Gmail meddling in triggered links. */
.x-gmail-data-detectors,
.x-gmail-data-detectors *,
.aBn {
border-bottom: 0 !important;
cursor: default !important;
}
/* What it does: Prevents Gmail from displaying an download button on large, non-linked images. */
.a6S {
display: none !important;
opacity: 0.01 !important;
}
/* If the above doesn't work, add a .g-img class to any image in question. */
img.g-img + div {
display:none !important;
}
/* What it does: Prevents underlining the button text in Windows 10 */
.button-link {
text-decoration: none !important;
}
h1 {
overflow: hidden;
text-align: center;
}
h2:before,
h2:after {
background-color: #777777;
content: "";
display: inline-block;
height: 1px;
position: relative;
vertical-align: middle;
width: 50%;
}
h2:before {
right: 0.8em;
margin-left: -50%;
}
h2:after {
left: 0.8em;
margin-right: -50%;
}
/* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
/* Create one of these media queries for each additional viewport size you'd like to fix */
/* Thanks to Eric Lepetit #ericlepetitsf) for help troubleshooting */
#media only screen and (min-device-width: 375px) and (max-device-width: 413px) { /* iPhone 6 and 6+ */
.email-container {
min-width: 375px !important;
}
}
#media only screen and (max-width: 600px){
.hero-img {
height:auto !important;
max-width:600px !important;
width: 100% !important;
}
}
</style>
<!-- Progressive Enhancements -->
<style>
/* What it does: Hover styles for buttons */
.button-td,
.button-a {
transition: all 100ms ease-in;
}
.button-td:hover,
.button-a:hover {
background: #ffd541 !important;
border-color: #ffd541 !important;
}
</style>
</head>
<body padding="0" width="100%" bgcolor="#ffffff" style="padding: 0; margin: 0; mso-line-height-rule: exactly;">
<center style="width: 100%; background: #ffffff; text-align: center; display: inline-block;"><!-- Visually Hidden Preheader Text : BEGIN -->
<div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;">Hidden text</div>
<!-- Visually Hidden Preheader Text : END --><!--
Set the email width. Defined in two places:
1. max-width for all clients except Desktop Windows Outlook, allowing the email to squish on narrow but never go wider than 600px.
2. MSO tags for Desktop Windows Outlook enforce a 600px width.
-->
<div class="email-container" style="max-width: 600px; margin: auto;"><!--[if mso]>
<table role="presentation" aria-hidden="true" cellspacing="0" cellpadding="0" border="0" width="600" align="center">
<tr>
<td>
<![endif]--><!-- Email Header : BEGIN -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%"><tr><td height="33" bgcolor="#0072bc" style="font-size: 0px; line-height: 0px;height:33px;" class=""> </td> </tr><tr><td bgcolor="#0072bc" align="center" class=""><img alt="companyname logo" src="http://www2.companynameweb.com/l/50342/2017-04-10/8frt4b/50342/155397/companyname_logo_lockup_white.png" aria-hidden="true" border="0" height="54" style="border-spacing: 0; min-height: 54px;display:block;"></td></tr><tr><td height="33" bgcolor="#0072bc" style="font-size: 0px; line-height: 0px;" class=""> </td></tr></table>
<!-- Email Header : END --><!-- Email Body : BEGIN -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%">
<tr>
<td align="left" height="5" style="font-family: sans-serif; font-size:1px; mso-line-height-rule: exactly; line-height:100%;" valign="top"> </td>
</tr>
<!-- Hero Image, Flush : BEGIN -->
<tr>
<td style="background: #ffffff" class=""><img alt="" aria-hidden="true" border="0" class="hero-img" src="http://www2.companynameweb.com/l/50342/2017-04-10/8frt4d/50342/155399/replaced_informed_employees.jpg" style="height: auto; background: #ffffff; border-width: 0px; width: 600px; line-height: 0px; color: #ffffff; max-width: 600px;display:block;" width="600"></td>
</tr>
<!-- Hero Image, Flush : END --><!-- 1 Column Text + Button : BEGIN -->
<tr>
<td height="53" style="font-size: 0px; line-height: 0px; min-height: 53px;" class=""> </td>
</tr>
<tr>
<td class="stack-column-center" style="font-family: 'Lato', sans-serif; line-height: 1.4em; color: #777777; text-align: center; padding: 0px 30px 0px 30px;" width="100%"><span style="color:#0072bc; font-size:18px;"><strong>It’s simple:</strong></span> lorem ipsum.<br>
<br>
lorem ipsum<em>replaceds</em>.</td>
</tr>
<tr>
<td height="40" style="font-size: 0px; line-height: 0px; min-height: 40px;" class=""> </td>
</tr>
</table>
<!-- Button : Begin -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="margin: auto;">
<tr>
<td class="button-td" pardot-data="link-underline:none !important;" style="border-radius: 12px; background: #FFC220; text-align: center; text-decoration: none !important;"><a class="button-a" href="http://www.companynameweb.com/" style="background: rgb(255, 194, 32); border: 15px solid rgb(255, 194, 32); font-family: sans-serif; font-size: 16px; letter-spacing: 1.5px; line-height: 1.1; text-align: center; display: block; border-radius: 4px; font-weight: bold; text-decoration: none !important;"><span class="button-link" style="color:#0072BC; text-transform: uppercase; text-decoration: none !important;"> SEE HOW IT WORKS </span></a></td>
</tr>
</table>
<!-- Button : END --><!-- Social : Begin -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" width="90%">
<tr>
<td height="50" style="font-size: 0px; line-height: 0px; min-height: 50px;" class=""> </td>
</tr>
<tr>
<td align="center" class="stack-column-center" style="font-family: sans-serif; line-height: 20px; color: #777777; padding: 0px 20px 0px 20px; overflow: hidden;">
<h2 style="font-size: 13px; text-transform: uppercase; text-align: center;">Follow us</h2>
</td>
</tr>
<tr>
<td height="40" style="font-size: 0px; line-height: 0px; min-height: 40px;" class=""> </td>
</tr>
<tr>
<td align="center" class=""><!--[if (gte mso 9)|(IE)]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
<tr>
<td align="center" valign="top" width="600">
<![endif]--></td>
</tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="max-width:600px;" width="100%">
<tr>
<td align="center">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="LinkedIn social icon" aria-hidden="true" height="29" src=".png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="YouTube social icon" aria-hidden="true" height="29" src=".png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="Facebook social icon" aria-hidden="true" height="29" src="png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
<td align="center" class=""><img alt="Twitter social icon" aria-hidden="true" height="29" src=".png" style="min-height: 29px; background: #ffffff; padding: 0 11px;" width="29"></td>
<td width="27" class=""> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="40" style="font-size: 0px; line-height: 0px; min-height: 40px;" class=""> </td>
</tr>
</table>
<!-- Social : END -->
<!-- Email Footer : Begin -->
<table align="center" bgolor="#e1e1e1" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:#e1e1e1; border-spacing: 0; max-width: 600px;" width="100%">
<tr>
<td height="39" style="border-spacing: 0; line-height: 0px;height: 39px;" class=""></td>
</tr>
<tr>
<td class="x-gmail-data-detectors" style="padding: 0px 10px 0px 10px; width: 100%; font-size: 8px; font-family: sans-serif; line-height: 11px; text-align: center; color: #2e2e2e;"><webversion style="color:#2e2e2e; text-decoration:underline; font-weight: bold;">View as a Web Page</webversion><br><br>
© Copyright 2017 <span style="font-weight: bolder;">companyname</span><br>
#companynameweb.com | phone<br>
<span style="font-weight: bolder;">companyname</span> Headquarters | address<br><br>
Click here to unsubscribe</td>
</tr>
<tr>
<td height="39" style="border-spacing: 0; line-height: 0px;height: 39px;" class=""></td>
</tr>
</table>
<!-- Email Footer : END --><!--[if mso]>
</td>
</tr>
</table>
<![endif]--></div>
</center>
</body>
</html>
Let me know if this works for you.
When building spacer rows, font-size and line-height must be declared as 0px (not 0).
<tr>
<td height="13" align="center" valign="middle" style="margin: 0; font-size: 0px; line-height: 0px;"> </td>
</tr>
I figured it out.
font-size: 0; line-height: 0;
needed to be defined in pixels, and I added
valign="middle"
to each table row's data.
I replaced:
<!-- Email Header : BEGIN -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%">
<tbody>
<tr>
<td height="33" bgcolor="#0072bc" style="font-size: 0; line-height: 0;" class=""> </td>
</tr>
<tr>
<td bgcolor="#0072bc" align="center" class=""><img alt="companyname logo" src="http://www2.companynameweb.com/l/50342/2017-04-10/8frt4b/50342/155397/companyname_logo_lockup_white.png" aria-hidden="true" border="0" height="54" style="border-spacing: 0; min-height: 54px;"></td>
</tr>
<tr>
<td height="33" bgcolor="#0072bc" style="font-size: 0; line-height: 0;" class=""> </td>
</tr>
</tbody>
</table>
<!-- Email Header : END -->
with:
<!-- Email Header : BEGIN -->
<table align="center" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%">
<tbody>
<tr>
<td bgcolor="#0072bc" height="33" style="display: block; font-size: 0px; line-height: 0px;" valign="middle" class=""> </td>
</tr>
<tr>
<td align="center" bgcolor="#0072bc" class=""><img alt="companyname logo" aria-hidden="true" border="0" height="54" src="http://www2.companynameweb.com/l/50342/2017-04-10/8frt4b/50342/155397/companyname_logo_lockup_white.png" style="vertical-align: middle; border-spacing: 0; min-height: 54px;" valign="middle"></td>
</tr>
<tr>
<td bgcolor="#0072bc" height="33" style="font-size: 0px; line-height: 0px;" valign="middle" class=""> </td>
</tr>
</tbody>
</table>
<!-- Email Header : END -->
and it now works in all clients. Same with the footer. I replaced:
<!-- Email Footer : Begin -->
<table align="center" bgolor="#e1e1e1" aria-hidden="true" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:#e1e1e1; border-spacing: 0; max-width: 600px;" width="100%">
<tr>
<td height="39" style="border-spacing: 0; line-height: 0; max-height: 39px; min-height: 39px;" class=""> </td>
</tr>
<tr>
<td class="x-gmail-data-detectors" style="padding: 0px 10px 0px 10px; width: 100%; font-size: 8px; font-family: sans-serif; line-height: 11px; text-align: center; color: #2e2e2e;"><webversion style="color:#2e2e2e; text-decoration:underline; font-weight: bold;">View as a Web Page</webversion><br><br>
© Copyright 2017 <span style="font-weight: bolder;">companyname</span><br>
#companynameweb.com | 1-111-111-1111<br>
<span style="font-weight: bolder;">companyname</span> Headquarters | address<br><br>
Click here to unsubscribe</td>
</tr>
<tr>
<td height="39" style="border-spacing: 0; line-height: 0; max-height: 39px; min-height: 39px;" class=""> </td>
</tr>
</table>
<!-- Email Footer : END -->
with:
<!-- Email Footer : Begin -->
<table align="center" aria-hidden="true" cellpadding="0" cellspacing="0" role="presentation" style="max-width: 600px;" width="100%">
<tbody>
<tr>
<td bgcolor="#e1e1e1" height="39" style="display: block; font-size: 0px; line-height: 0px;" valign="middle" class=""> </td>
</tr>
<tr>
<td bgcolor="#e1e1e1" border="0" class="x-gmail-data-detectors" style="vertical-align: middle; border-spacing: 0; font-size: 8px; font-family: sans-serif; line-height: 11px; text-align: center; color: #2e2e2e;" valign="middle"><webversion style="color:#2e2e2e; text-decoration:underline; font-weight: bold;">View as a Web Page</webversion><br>
<br>
© Copyright 2017 <span style="font-weight: bolder;">eni</span><br>
#companynameweb.com 1-111-111-1111<br>
<span style="font-weight: bolder;">companyname</span> Headquarters | address<br>
<br>
Click here to unsubscribe</td>
</tr>
<tr>
<td bgcolor="#e1e1e1" height="39" style="display: block; font-size: 0px; line-height: 0px;" valign="middle" class=""> </td>
</tr>
</tbody>
</table>
<!-- Email Footer : END -->
and now it doesn't break anymore. td also needed bgcolor.
Adding this simple css style has worked for me :
<table style="border-spacing: 0 !important; border-collapse: collapse !important;"> </table>
I'm creating a responsive email design where several images switch out for the smaller screens. I've reformatted tables and tds several times and the smaller images don't show. The images are live online. Please help.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Happy St. Patrick's Day</title>
<style type="text/css">
body { margin: 0px; padding: 0px; }
#media only screen and (max-width: 660px) {
table.one { width: 480px !important; }
table.two { width: 480px !important; }
table.three { width: 480px !important; }
table.four { width: 480px !important; }
table.five { width: 480px !important; }
td.shamtop img { display: none; }
td.shamtop { background: #00A160 url(http://www.poscorp.com/emarketing/2015/images/top-shamrock-med.gif) no-repeat; height: 79px; }
td.shammid img { display: none; }
td.shammid { background: #00A160 url(http://www.poscorp.com/emarketing/2015/images/mid-shamrock-med.gif) no-repeat; height: 151px; }
td.maintext p {font-size: 26px; }
}
#media only screen and (max-width: 510px) {
table.one { width: 300px !important; }
table.two { width: 300px !important; }
table.three { width: 300px !important; }
table.four { width: 300px !important; }
table.five { width: 300px !important; }
td.shamtop img { display: none; }
td.shamtop { background: #00A160 url(http://www.poscorp.com/emarketing/2015/images/top-shamrock-sm.gif) no-repeat; height: 79px; }
td.shammid img { display: none; }
td.shammid { background: #00A160 url(http://www.poscorp.com/emarketing/2015/images/mid-shamrock-sm.gif) no-repeat; height: 89px; }
}
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="600" border="0" cellspacing="0" cellpadding="0" class="one" align="center">
<tr>
<td bgcolor="#00a160" class="shamtop" style="background: #00A160; margin: 0px;"><img src="http://www.poscorp.com/emarketing/2015/images/top-shamrock-lrg.gif" width="600" height="79"></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="two">
<tr>
<td bgcolor="#ffffff" class="maintext" style="font-family: Arial, Helvetica, sans-serif; font-size: 32px; line-height:120%; color: #000; background: #FFF; padding: 15px 18px 10px 18px; font-weight:bold; text-align:center;"><p style="margin-top: 0px; margin-bottom: 16px;">In honor of St. Patrick’s Day we’d like to save you some <span style="color: #00a160;">GREEN</span>!</p></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="three">
<tr>
<td class="shammid" bgcolor="#b7da63" style="background: #b7da63;"><img src="http://www.poscorp.com/emarketing/2015/images/mid-shamrock-lrg.gif" width="600" height="195"></td>
</tr>
<tr>
<td align="center" bgcolor="#b7da63" style="background: #b7da63; font-family: Arial, Helvetica, sans-serif; font-size: 17px; line-height:120%; color: #000; padding: 15px 20px 10px 20px; font-weight:bold; text-align:center;"><p style="font-size:22px; margin-top:0px; margin-bottom: 7px;">Enter to Win $200 Towards a NEW Print Item.</p>
<p style="margin-top:0px; margin-bottom: 0px;">All entries must be made by the end of day today. <br>
Five winners will be drawn.</p></td>
</tr>
<tr>
<td align="center" bgcolor="#b7da63" style="background: #b7da63; padding: 0px 20px 15px 20px; text-align:center;"><img src="http://www.poscorp.com/emarketing/2015/images/enter-to-win-btn.gif" width="180" height="45"></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="four">
<tr>
<td align="center" valign="top" class="contact" style="font-family: Arial, sans-serif; font-size: 14px; line-height:115%; color: #333; background: #FFF; padding: 20px 20px 20px 20px;">
<table width="275" border="0" cellspacing="0" cellpadding="0" align="left" class="logo">
<tr>
<td class="poslogo"><img src="http://www.poscorp.com/emarketing/2015/images/pos_logo_hc.gif" alt="POS Professional Office Services, Inc." width="272" height="45"></td>
</tr>
</table>
<table width="275" border="0" cellspacing="0" cellpadding="0" align="right" class="info">
<tr>
<td><p style="font-family: Arial, sans-serif; font-size: 14px; line-height: 100%; color: #333; font-weight:bold; margin:20px 0px 5px 0px; text-align:right;">800.331.4976 | www.poscorp.com | <img src="http://www.poscorp.com/emarketing/2015/images/linkedin.jpg" alt="LinkedIn" width="16" height="16" border="0" style="vertical-align:bottom;"/></p></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="five">
<tr>
<td align="center" valign="top" style="font-family: Arial, sans-serif; font-size: 12px; line-height:115%; color: #FFF; background: #00a160; padding: 5px 15px 5px 15px; margin:0px; font-style:italic;"><p>This offer is non-transferable and entries are limited to one entry per recipient.<br>
Contest winners will be notified by March 19th.</p></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html
Your html has a defined style which is overriding the css on your elements. For instance, changing:
<td class="shammid" bgcolor="#b7da63" style="background: #b7da63;">
<img src="http://www.poscorp.com/emarketing/2015/images/mid-shamrock-lrg.gif" width="600" height="195">
</td>
to
<td class="shammid" bgcolor="#b7da63">
<img src="http://www.poscorp.com/emarketing/2015/images/mid-shamrock-lrg.gif" width="600" height="195">
</td>
Yields the result you're looking for.
You should also consider removing the bgcolor attribute as it has been deprecated in HTML5.