我试图让我的电子邮件背景工作。 当我使用:电子邮件背景图像作为URL工作,但不作为目录
style="background: #3b72bb url('https://s1.postimg.org/sample/image.jpg') no-repeat; background-size: cover;"
它工作正常。
但由于我使用的是:
style="background: #3b72bb url('img/image.jpg') no-repeat; background-size: cover;
我再也不能看到我的背景图片。
文件夹结构:
index.html
img/
image.jpg
我使用的平台,将图像与旁边index.html
。 图片为:
<img src="img/leftphoto.jpg" alt="" width="274" height="550" border="0" style="color: #1f1f1f; border: none; display: block; font-size: 12px; line-height: 34px; text-align: left;">
工作正常。 我曾试过各种选择:
style="background: #3b72bb url('/img/image.jpg') no-repeat; background-size: cover;
style="background: #3b72bb url('../img/image.jpg') no-repeat; background-size: cover;
而且一开始。他们都没有工作。 它需要作为图像发送,而不是URL。
你需要坚持绝对的文件路径,电子邮件客户端从服务器远程下载图像,所以它需要知道在哪里看。 – UncaughtTypeError
你能写样本路径吗? –
http://yourserver.whatever/images/yourimage.jpg。本地路径适用于您,因为您的计算机上有图像。懂吗? – scoopzilla