2016-05-13 18 views
1

業餘愛好者在編碼時尤其如此,特別是涉及到電子郵件模板時。我很難讓G-mail真正隱藏和正確顯示內容。我在這裏搜索並找到了一些我認爲會有所幫助的答案,但它似乎不適合我的代碼。截至目前,轉發時不擔心代碼。用於隱藏和顯示圖像和文本的電子郵件模板

這裏是具體的圖像的代碼部分。會愛上它的一些眼睛,也有一些幫助。一切都在一張桌子上,並且在普通瀏覽器中運行正常......只是專門在G-mail中尋求幫助。

CSS:

@media only screen and (min-width: 480px) { 

    .mobilechart { 
    display: none !important; 
    } 
} 

@media only screen and (max-width: 480px) { 

    .desktopchart { 
    display: none !important; 
    } 

HTML:

<tr> 
    <td style="background-repeat:no-repeat;background-position:right;" > 
    <div class="desktopchart"> 
     <img src="https://cdn.maropost.com/pro/uploads/account_415/77640/TC-Email_Template_DESKTOPCHART.jpg" style="width:100%;margin-top:auto;margin-bottom:auto;margin-right:auto;margin-left:auto;" > 
    </div> 
    <div class="mobilechart"> 
     <img src="https://cdn.maropost.com/pro/uploads/account_415/77641/TC-Email_Template_MOBILECHART.jpg" style="width:100%;margin-top:auto;margin-bottom:auto;margin-right:auto;margin-left:auto;" > 
    </div> 
    </td> 
</tr> 
+1

可能重複的[通訊不能隱藏敏感內容在Gmail上,當我嘗試轉發電子郵件](http://stackoverflow.com/questions/37182935/newsletter-cant-hide-responsive-content- gmail-and-when-i-try-to-forward-the) – Shaggy

回答

1

轉貼我的回答this question

這裏的壞消息是,很抱歉,Gmail尚不支持媒體查詢也不支持display,overflowvisibility屬性。

查看Campaign Monitor's CSS Support Guide for Email Clients瞭解更多信息。

除了重寫您的通訊是完全流暢的,而不是試圖使其響應,恐怕沒有真正的解決方案在這裏。

+0

謝謝。我害怕那樣......這傷害了我的心。 –

相關問題