4件事情蝙蝠:
1)內聯樣式表。大多數客戶將刪除樣式表或重寫它。
2.)使用Tables not Divs。客戶表中的表格更可靠。
3.)幾乎所有的電子郵件客戶端都會完全忽略最大寬度。要使用Outlook解決此問題,請創建一個帶有650寬度表格(或)的條件語句,或者使用媒體查詢並使其響應。
4)同樣的Outlook不能識別文字陰影
最好的辦法是建立一個100%的寬度表(高度是無用的,通常捲起你希望的背景顏色打破了佈局反正)。這與爲身體分配顏色(並不總是被支持,但從不傷害添加)相結合,應該給你你想要創建的背景。
從那裏只需創建你想要的尺寸的另一個表。除非使用「Cellpadding」或「Cellspacing」HTML屬性,否則Outlook通常會忽略邊距和填充。使用這些屬性或內聯CSS是你最好的選擇。
我分離出CSS作爲聲明單獨幫助支持。還增加了一些很好的樣式,包括跨客戶端支持,並使其對媒體查詢的響應。
示例代碼:
<html>
<head>
<style type="text/css">
/* Client-specific Styles and Fixes */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0; line-height: 100% !important;}
/*TABLET STYLES*/
@media only screen and (max-width: 479px) {
table[class=Responsive] {width: 100% !important;}
}
/*MOBILE STYLES*/
@media only screen and (max-width: 479px) {
table[class=Responsive] {width: 100% !important;}
}
</style>
</head>
<body yahoo="fix" bgcolor="#F7F7F7" width="100%" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<table width="100%" bgcolor="#F7F7F7" cellpadding="0" cellspacing="0" border="0" id="backgroundTable" align="center" style="border-width:1px; border-style:solid; border-color:#E4E4E4;">
<tr>
<td align="center">
<table width="650" class="Responsive" cellpadding="15" cellspacing="0" border="0" style="font-family:Georgia, Times New Roman, Times, Serif; font-size:12px; color:#888888;">
<tr>
<td align="center" style="font-family:Georgia, Times New Roman, Times, Serif; font-size:12px; color:#888888;"><h2>New message from {{ user }} ({{ email }})</h2>
<p>Message below:</p>
<p>{{ message }}</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
我個人不使用標題標籤,甚至真的p標籤,而是留在了你。希望這可以幫助。
這幫了很多,謝謝:) – Jon 2014-11-17 13:14:37