Outlook 2007/2010 中的 Vspace (Vspace in Outlook 2007/2010)


問題描述

Outlook 2007/2010 中的 Vspace (Vspace in Outlook 2007/2010)

I have an html newsletter which works in most email carriers but the formatting is messed up in outlook. I have put vspace="10" on the image tag to put 10px margin on the top and bottom of the image to have a space between the image and text below it. However, in Outlook the vspace is not being picked up and the text appears directly under the image with no space between.

Does anyone know how to get this to work? I tried to put a margin‑bottom of 10px on the image, but again this did not work.

‑‑‑‑‑

參考解法

方法 1:

It might be easier to use a nested table and define the height of the row to be 10px. What you are contending with in Outlook 2007+ is Word HTML rendering which handles CSS in it's own special way.

方法 2:

With HTML Email there is a lot of nuances between the different browsers. One thing i have learnt from creating emails is that it needs to be extremely simple. Both margin & padding are not supported by Outlook (due to it using the word rendering engine).

The solution

Replace the image and the space with a table containing 2 spacer gifs and the image in the centre. For example (you need to use absolute paths to your images):

<table cellpadding="0" cellspacing="0">
  <tr>
    <td>
      <img style="display:block" border="0" src="images/spacer.gif" width="IMAGEWIDTH" height="10" />
    </td>
  </tr>
  <tr>
    <td>
      <img style="display:block" border="0" src="YOUR IMAGE" width="" height="" />
    </td>
  </tr>
  <tr>
    <td>
      <img style="display:block" border="0" src="images/spacer.gif" width="IMAGEWIDTH" height="10" />
    </td>
  </tr>
</table>

(by LegacyTerrorJacobUndefined)

參考文件

  1. Vspace in Outlook 2007/2010 (CC BY‑SA 3.0/4.0)

#html-email #email #outlook #html






相關問題

Outlook 2007/2010 中的 Vspace (Vspace in Outlook 2007/2010)

Outlook,gmail基本問題(導致代碼) (Outlook, gmail basic issue (caused the code))

Outlook 中的 HTML 電子郵件呈現 - VML (HTML Email Render in Outlook - VML)

Адправіць пошту HTML з дапамогай NAIL? (Send HTML mail with NAIL?)

支持所有郵件服務的 HTML 電子郵件生成 (HTML email generation that supports all mail services)

如何在時事通訊的 html 單元格中均勻分佈內容? (How to evenly distribute content across an html cell for a newsletter?)

發送預先電子郵件的最佳方式 (Best way for sending advance email)

在 Outlook 上隱藏移動表格 (Hide mobile table on outlook)

html emailer改變表格的位置 (html emailer shifting changing the position of tables)

電子郵件的可滾動表(沒有 div) (Scrollable table for e-mails (without a div))

如何在電子郵件中嵌入 Web 表單 (How to embed web form in email)

如何通過電子郵件訪問建立 QuickAssist 鏈接 (How to make a QuickAssist link through email access)







留言討論