【问题标题】:HTML code isn't working on Inbox by GmailHTML 代码在 Inbox by Gmail 上不起作用
【发布时间】:2016-08-02 12:30:41
【问题描述】:

我可以通过在 Gmail 中使用以下代码来隐藏表格,但同样不适用于 Google 的 Inbox。请查看以下代码并帮助我在 Inbox by Google 上隐藏此表格。

<!--[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]-->

【问题讨论】:

  • 这是您发送的电子邮件吗?你还没有很好地解释你的问题。如果是电子邮件,您不能使用现代 CSS 和 HTML 编写电子邮件代码。你需要回到 HTML4 标准和 CSS1 可能是 CSS2
  • @Andrew,您可以轻松编写 CSS 电子邮件,并且可以应用一些 CSS3 规则,但 CSS 需要是内联样式而不是类和 id。

标签: html css html-email google-inbox


【解决方案1】:

您确实没有提交足够多的示例让我了解发生了什么,但是您使用!important 的事实向我表明您没有使用内联样式。试试看,电子邮件很难处理,但内联通常效果更好。

【讨论】:

    【解决方案2】:

    这应该涵盖你所有的基础(作为内联 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>
    

    【讨论】:

    • 我在您的答案中添加了一个内联示例,当您的答案适合所需的 CSS 时,我可以节省下另一个答案。 :-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-18
    • 1970-01-01
    • 1970-01-01
    • 2017-02-19
    • 2013-12-15
    • 2014-03-07
    • 1970-01-01
    相关资源
    最近更新 更多