我正在尝试为电子邮件 html 模板将背景图像添加到表格元素 tr。还有一个显示在图像顶部的文本。
The text is dynamic coming from a from field so I can not make it as image in table elements.
我的代码如下
<tr>
<td background="http://bit.ly/1HXqys9" bgcolor="#c0393f" style="background-image: url('http://bit.ly/1HXqys9');width:600px;height:240px" width="600" height="240" valign="top" >
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:240px;">
<v:fill type="tile" src="hhttp://bit.ly/1HXqys9" color="#c0393f" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<p style="color:#c9be8a;font-weight:700;font-size:19px;width:220px; text-transform:uppercase ;margin:147px 0px 0px 107px; ">
Hello. This is my text.
</p>
</td>
</tr>
此问题是背景图像未显示在以下电子邮件客户端中
- Outlook 2007、Outlook 2010、Outlook 2011、Outlook 2013、Gmail Firefox、Gmail chrome、Outlook.com 资源管理器、Outlook.com Chrome、Yahoo Mail Explorer、Yahoo Mail Chrome
最佳答案
你能不能把代码放在一个表里试试。我认为它会起作用
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="http://bit.ly/1HXqys9" bgcolor="#c0393f" style="background-image: url('http://bit.ly/1HXqys9');width:600px;height:240px" width="600" height="240" valign="top" >
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:240px;">
<v:fill type="tile" src="hhttp://bit.ly/1HXqys9" color="#c0393f" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<p style="color:#c9be8a;font-weight:700;font-size:19px;width:220px; text-transform:uppercase ;margin:147px 0px 0px 107px; ">
Hello. This is my text.
</p>
</td>
</tr>
</table>
关于html - 如何创建一个多电子邮件客户端 html 模板,以便在所有客户端中显示顶部带有文本的背景图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29813583/