我正在编写html电子邮件for outlook,我必须添加整个背景图像,我找到this article并尝试使用它,我得到了我需要的代码,但问题是我无法得到如何使用它,这是我从这个链接中找到的
瘦子是你必须replace your <html> tag with:<html xmlns:v="urn:schemas-microsoft-com:vml">
...然后将它添加到你的样式中,你想要添加背景图像:v:* { behavior: url(#default#VML); display: inline-block; }As for the <td>
,在单元格中添加以下内容(宽度和高度)是图像的尺寸):
我的<td>
代码就像这样
<td height="296" colspan="2" valign="top" background="image.png" class="bodyContent" style="border-collapse: collapse">
<div id= "main_content" > content </div>
</td>
我如何将上述代码与此相关联以添加背景图片,请检查链接并帮助我。
答案 0 :(得分:1)
根据emailbg.net说明,您的代码应如下所示:
编辑:添加了整个电子邮件作为测试发送给我自己,它在Outlook中按预期工作:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title>
</head>
<body style="margin: 0px; padding: 0px; background-color: #FFFFFF;" bgcolor="#FFFFFF"><table bgcolor="#cccccc" width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><table width="640" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td valign="top" style="padding-top:30px; padding-bottom:30px;">
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td background="http://lorempixel.com/400/296/" bgcolor="#f6f6f6" height="296" width="400" colspan="2" valign="top" class="bodyContent" style="border-collapse: collapse;">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:400px;height:296px;">
<v:fill type="tile" src="http://lorempixel.com/400/296/" color="#f6f6f6" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
<div id= "main_content" > content </div>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr></table>
</td></tr></table></td></tr></table></body></html>
只需将图像换成相对图像,然后将宽度更改为您需要的图像。
答案 1 :(得分:0)
将背景图像添加到Outlook中的邮件中 将图像插入到您在Outlook中撰写的电子邮件的背景中
将背景图像添加到Outlook 2000,Outlook 2002和Outlook 2003中的邮件中 要在Outlook中向邮件添加背景图像(前提是您不使用Word编辑电子邮件):
http://email.about.com/od/outlooktips/qt/How_to_Add_a_Background_Image_to_a_Message_in_Outlook.htm