2016-08-05 127 views
0

我知道這是非常普遍的問題,但我嘗試了所有建議的解決方案,沒有任何工作。Outlook電子郵件丟失左填充

電子郵件模板我在Outlook瀏覽器中丟失了左邊距。我想爲outlook添加左邊距/填充,並讓它在其他瀏覽器中被忽略,因爲它們看起來很好,並且不需要額外的邊距。我只需要在沒有任何樣式的情況下使用內聯css來修復它。我在我的CSS中沒有使用任何邊距或填充。

這裏是我的代碼:

<table cellpadding="0" cellspacing="0" width="598" style="width: 598px;"> 
     <tr> 
      <td><span style="width:45px;height:20px;"><div style="width:25px;height:20px;">&nbsp;</div></span></td> 
      <td> 
       <span style="width:45px;height:15px;"><div style="width:25px;height:15px;">&nbsp;</div></span> 
       <div>some text</div> 
       <span style="width:45px;height:15px;"><div style="width:25px;height:15px;">&nbsp;</div></span> 
       <div>some text</div> 
       <span style="width:45px;height:20px;"><div style="width:25px;height:20px;">&nbsp;</div></span> 
       <div>some text</div> 
       <span style="width:45px;height:40px;"><div style="width:25px;height:20px;">&nbsp;</div></span> 
       <div>some text,</div> 
       <span style="width:45px;height:20px;"><div style="width:25px;height:20px;">&nbsp;</div></span> 
       <div>some text</div> 
       <span style="width:45px;height:5px;"><div style="width:25px;height:5px;">&nbsp;</div></span> 
      </td> 
      <td><span style="width:45px;height:20px;"><div style="width:25px;height:20px;">&nbsp;</div></span></td> 
     </tr> 
    </table> 

我嘗試添加填充到每一個TD元素,但同時它在展望修復鑑於它在其他瀏覽器中增加了額外的填充。添加&nbsp;的結果相同。

任何幫助表示讚賞!

+0

你嘗試保證金:自動? –

+0

據我所知,保證金被outlook – yinjia

+0

忽略是的,你是對的!但你有沒有試過在桌子上玩「cellpadding和cellspacing」? –

回答

-3
<table cellpadding="0" cellspacing="0" width="598" style="width: 598px;"> 
     <tr> 
      <td style="width:100%;padding-left:10px"> 
       <tr> 
       <td> 
        <table> 
        <!-- your content here--> 
        </table> 
       </td> 
       </tr> 
      </td> 
     </tr> 
</table> 

嘗試在主TD和風格它包裹的內容。這將強制整個電子郵件正文的填充。我已經嘗試過這種方法,併爲我工作。嘗試一下,讓我知道這是否有幫助。

+0

謝謝,雖然這沒有解決問題 - 它爲所有瀏覽器添加了額外的填充,不僅展望 – yinjia

+2

這甚至不是有效的HTML ... –

+0

@MikeMcCaughan你爲什麼這麼認爲? –