【发布时间】:2016-07-28 18:13:04
【问题描述】:
我正在构建一个 HTML 邮件,其中应该是一个顶部带有数字的图像。 到目前为止,我已将图像添加为带有嵌套表格的 td-background 以定位文本。它在大多数电子邮件客户端中看起来都不错,除了…… Outlook。 Outlook 呈现文本 - 向右(Outlook 2003) - 太高(Outlook 2007 及更高版本)
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td background="https://s31.postimg.org/57s9ntmij/basket_3.png" bgcolor="#ffffff" width="35" height="30" valign="top" style="font-size: 0;">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:35px;height:30px;">
<v:fill type="frame" src="https://e.kaartje2go.nl/public/Kaartje2go/8553f93ebcf5d20eb1da4a3b8abeaaba/basket_3.png" color="#ffffff" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<table cellpadding="0" cellspacing="0" border="0" width="30" style="line-height:20px;">
<tr>
<td width="20"></td>
<td height="15" align="center" valign="middle" style="font-size: 12px; font-family: 'Source Sans Pro', Arial, sans-serif; color:#ffffff;font-weight:700; line-height:20px;" >
2
</td>
</tr>
</table>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
</table>
HTML 可以在这里找到:http://codepen.io/anon/pen/kXpKRQ?editors=1000
我尝试了不同的高度和线高,但似乎没有任何帮助。 有人可以帮我固定文本的位置吗? 非常感谢!
【问题讨论】:
-
某些标签和 css 在电子邮件模板中不起作用。请参考这个解决方案freshmail.com/developers/best-practices-for-email-coding
标签: html css email outlook html-email