asp.net中html电子邮件中的背景图像css
我需要发送邮件的图像作为邮件正文嵌入。下面是代码asp.net中html电子邮件中的背景图像css,asp.net,Asp.net,我需要发送邮件的图像作为邮件正文嵌入。下面是代码 <!DOCTYPE html> <html> <head></head> <body> <div style="background: url(http://localhost/image/mvp-bg.jpg) no-repeat top left; width: 800px; height:685px; margin: 0 auto; color: #ffffff;
<!DOCTYPE html>
<html>
<head></head>
<body>
<div style="background: url(http://localhost/image/mvp-bg.jpg) no-repeat top left; width: 800px; height:685px; margin: 0 auto; color: #ffffff; font-family: Arial; font-size: 16px;">
<div style="width: 700px; margin: 0 auto; padding-top: 80px;">
<p>Mail Body</p>
</div>
</div>
</body>
</html>
邮件正文
谁能告诉我怎么解决这个问题吗。
感谢有关电子邮件模板的信息,请更好地参考服务器上的图像,而不是
localhost
,您不能期望用户将图像加载到其localhost:)
将其更改为url(http://domain.com/image/mvp-bg.jpg)
从中获取解决方案。下面是我修改的代码,以便在邮件中正确呈现css。当使用标记时,css没有呈现,因此instaed使用了表标记
<!DOCTYPE html>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<style type="text/css">
v\:*
{
behavior: url(#default#VML);
display: inline-block;
}
</style>
</head>
<body>
<table style="background-image: url('image/mvp-bg.jpg'); background-repeat: no-repeat;width: 800px; height:685px; margin: 0 auto; color: #ffffff; font-family: Arial; font-size: 16px;" >
<!--[if gte vml 1]>
<v:shape
stroked='f'
style='position:absolute;margin-left:-90pt;margin-top:-1.55pt;
z-index:-503306481;
visibility:visible;
width:720pt;
height:475pt;
top:0;
left:0;
border:0;
'>
<v:imagedata src="http://www.domain.com/image/mvp-bg.jpg"/>
</v:shape>
<![endif]-->
<tbody>
<tr>
<td>
<div style="width: 700px; margin: 0 auto; padding-top: 85px; font-family: Arial; font-size: 16px;">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="2" valign="top" style="padding: 10px; color: #ffffff;">
Mail Body
</td>
</tr>
</table>
</div>
</td>
</tr>
</tbody>
</table>
v\:*
{
行为:url(#默认值#VML);
显示:内联块;
}
邮件正文
如果您发送电子邮件,您将无法引用客户端计算机上的localhost,除非他们使用相同的目录结构设置了web服务器。将url similat更改为“”并不能解决我的问题。请帮忙