I have following html in email template.
I am getting different view in MS Outlook and in gmail for the same.
-
My solution is to use an empty / whichever is needed with a transparent spacer gif since padding isnt 100% supported.
<td width="2" style="font-size:1px; line-height:1px;" bgcolor="#FFFFFF">
<img width="2" border="0" src="spacer50.gif" style="display:block;
padding:0; margin:0; border:none;" />
</td>
讨论(0)
-
To create HTML in email template that is emailer/newsletter, padding/margin is not supporting on email clients. You can take 1x1 size of blank gif image and use it.
<tr>
<td align="left" valign="top" style="background-color:#7d9aaa;">
<table width="640" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left" valign="top" colspan="5"><img style="display:block;" src="images/spacer.gif" width="1" height="10" alt="" /></td>
</tr>
<tr>
<td align="left" valign="top"><img style="display:block;" src="images/spacer.gif" width="20" height="1" alt="" /></td>
<td align="right" valign="top"><font face="arial" color="#ffffff" style="font-size:14px;"><a href="#" style="color:#ffffff; text-decoration:none; cursor:pointer;" target="_blank">Order Confirmation</a></font></td>
<td align="left" valign="top" width="200"><img style="display:block;" src="images/spacer.gif" width="200" height="1" alt="" /></td>
<td align="left" valign="top"><font face="arial" color="#ffffff" style="font-size:14px;">Your Confirmation Number is 260556</font></td>
<td align="left" valign="top"><img style="display:block;" src="images/spacer.gif" width="20" height="1" alt="" /></td>
</tr>
<tr>
<td align="left" valign="top" colspan="5"><img style="display:block;" src="images/spacer.gif" width="1" height="10" alt="" /></td>
</tr>
</table>
</td>
</tr>
讨论(0)
-
In some cases we set border instead of padding and it works in outlook.
border: solid #efeeee;border-width: 20px 40px;
讨论(0)
-
All styling including padding have to be added to a td not a span.
Another solution put the text into <p>text</p>
and define margins, and that should give the required padding.
For example:
<p style="margin-top: 10px; margin-bottom: 10; margin-right: 12; margin-left: 12;">text</p>
讨论(0)
-
have you tried display:inline-block;
?
讨论(0)
-
Make sure to throw on the !important
for Outlook especially.
td {
border-collapse: separate;
padding: 15 !important
}
I also wanted borders, so might not work for someone who doesn't.
讨论(0)
- 热议问题