2016-08-02 34 views
-1

我可以通過在Gmail中使用下面的代碼來隱藏表格,但同樣不適用於Google收件箱。請查看以下代碼,並幫助我將此表格隱藏在Google的收件箱中。HTML代碼在Gmail收件箱中不起作用

<!--[if !mso]><!--><table cellspacing="0" cellpadding="0" class="mobileShow" align="center" style="width:320px; background-color:#ffffff; max-height: 0px !important; display: none !important; overflow:hidden; float:left; line-height:0px; mso-hide: all;"> 
<tr> 
    <td style="width:85px;"> 
     <table cellspacing="0" cellpadding="0" style="width:85px; background-color:#f8f8f8;"> 
      <tr> 
       <td style="width:85px; height:66px; background-color:#ffffff;"></td> 
      </tr> 
      <tr> 
       <td style="width:85px; height:159px; background-color:#f8f8f8;"></td> 
      </tr> 
     </table> 
    </td> 
    <td style="width:150px; background:url(http://in.bmscdn.com/events/Large/ET00041490.jpg) no-repeat center center; height:225px; background-color:#adadad; border-radius:5px; background-size: 100% 225px;"><a href="https://in.bookmyshow.com/movies/half-ticket/ET00040972?&utm_source=ReviewBMS02Aug2016&utm_medium=email&utm_campaign=HalfTicket#trailer" target="_blank" style="text-decoration:none;"><img src="http://in.bmscdn.com/mailers/images/160720bmsreview/playbtn.png" style="margin:75px auto;display:block;" height="60" border="0" width="60"></a></td> 

    <td style="width:85px;"> 
     <table cellspacing="0" cellpadding="0" style="width:85px; background-color:#f8f8f8;"> 
      <tr> 
       <td style="width:85px; height:66px; background-color:#ffffff;"></td> 
      </tr> 
      <tr> 
       <td style="width:85px; height:159px; background-color:#f8f8f8;"></td> 
      </tr> 
     </table> 
    </td> 
</tr></table><!--<![endif]--> 
+3

這是您發送電子郵件?你沒有真正解釋你的問題。如果是電子郵件,則不能使用現代CSS和HTML編寫電子郵件代碼。您需要回到HTML4標準,CSS1可能是CSS2 – Andrew

+0

@Andrew您可以輕鬆編寫CSS電子郵件,並且可以應用一些CSS3規則,但CSS需要**內聯樣式**而不是類和標識。 – Martin

回答

0

你真的沒有足夠的提交一個例子,我明白這是怎麼回事,但你不使用內聯樣式的事實,你正在使用!important建議給我。嘗試一下,電子郵件是一個痛苦的工作,但內聯通常效果更好。

0

這應該覆蓋所有客戶羣(如內聯CSS)

{ 
    display:none; 
    font-size:1px; 
    line-height:1px; 
    max-height:0px; 
    max-width:0px; 
    opacity:0; 
    overflow:hidden; 
    mso-hide:all; 
} 

編輯(如內聯):

<table style='display:none;font-size:1px;line-height:1px; 
       max-height:0;max-width:0;opacity:0;overflow:hidden; 
       mso-hide:all;' cellspacing='0' cellpadding='0' border=0> 
+1

我在你的答案中增加了一個內聯示例,可以幫助我節省時間,以適應需要的CSS。 ':-)' – Martin

+0

輝煌,謝謝! –