2017-04-25 85 views
1

我遇到了css中的background-image問題。問題是我不能在電子郵件模板中使用背景圖像。
要解決此問題,我可以使用<img>標記,問題是我有一些文字放置在圖像的前面。
所以...我想知道的是,如果有任何選項可以避免使用背景圖像,請使用<img>並在頂部放置一些文本。這裏是我的代碼:
試圖在不使用background-img的情況下創建電子郵件模板

<table align="left" border="0" cellpadding="0" cellspacing="0" style="max-width:100%;min-width:100%;border-collapse:collapse;" width="100%" class="mcnTextContentContainer"> 
    <tbody> 
    <tr> 
     <td valign="top" class="mcnTextContent" style="padding-top:0;padding-right:18px;padding-bottom:9px;padding-left:18px;color:#808080;font-family:Helvetica;font-size:16px;line-height:150%;text-align:left;background-color: #003b5d;background:url('http://example.com/images/bg-hero.jpg');"> 
     <h2 class="null" style="text-align:center;height:100px;color:#FFF;display:block;margin:0;padding:0;font-family:Helvetica;font-size:34px;font-style:normal;font-weight:bold;line-height:150%;letter-spacing:normal;padding-top:50px;">A friendly message</h2> 
     </td> 
    </tr> 
    </tbody> 
</table> 


我想是更換背景圖片background:url('http://example.com/images/bg-hero.jpg'); 代碼

回答

1

也許這個CSS可以幫助你!它適用於我的電子郵件模板。

body { 

background-image: url('http://example.com/images/bg-hero.jpg'); 

background-repeat: repeat-y no-repeat; 

background-color: #333; 

margin: 0; 

padding: 0; 

} 
+0

仍然不能正常工作......但僅在Outlook版本中 – RuiVBoas

+0

僅適用於Outlook版本的只適用於Outlook版本的NOT版本? –

+1

不幸的是由於他們的Microsoft Office渲染引擎,outlook不支持背景圖像(以及其他很多東西)。 每個郵件客戶端支持的屬性列表可以在這裏找到: https://www.campaignmonitor.com/css/ –

相關問題