我試圖讓我的電子郵件背景工作。 當我使用:電子郵件背景圖像作爲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