Outlook桌面版本的条件注释无效

时间:2016-09-10 07:49:20

标签: outlook html-email email-client

我对Outlook桌面版的条件评论一直遇到问题。在Outlook 2013中查看电子邮件时,它仍然显示边框和与非mso客户端相同的字体大小。

我还将条件注释放在head标签中,但它也没有用。

如果你们中的任何一个人在代码中某处发现了拼写错误或错误?

这就是我正在使用的整个代码:

<html xmlns="http://www.w3.org/1999/xhtml">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
    <title>Outlook conditional comments</title>

    <meta charset="ISO-8859-1">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keywords" content="">

</head>

    <body>
    <!--[if gte mso 9]>
    <table class="lookout" border="0" cellpadding="0" cellspacing="0" align="left" style="max-width: 600px; 
    width: 100%; height: auto; font-size:3em;"> <tbody> <tr> <td>Increasing sales </td> </tr> </tbody> </table>
    <![endif]-->
        <table class="lookout" border="1" cellpadding="0" cellspacing="0" align="center" style="max-width: 600px; width: 100%; height: auto; font-size:1em;">
            <tbody>
                <tr>
                    <td>Increasing Sales</td>
                </tr>
            </tbody>
        </table>
</body>
</html>

非常感谢提前 丹尼尔

3 个答案:

答案 0 :(得分:1)

它显示边框,因为第二个<table>未从Outlook隐藏。 Outlook 2007/10/13/16显示<table> s。

我们要编写两个表并将其分别包含在<mso>标记中:一个显示一个<table>仅用于Outlook 2007/10/13/16,另一个仅为Outlook 2007/10/13/16隐藏 <table>。像这样:

<body>
    <!--[if gte mso 9]>
    <table class="lookout" border="0" cellpadding="0" cellspacing="0" align="left" style="max-width: 600px; 
    width: 100%; height: auto; font-size:3em;">
        <tbody>
            <tr>
                <td>Increasing sales In Outlook 2007/10/13/16</td>
            </tr>
        </tbody>
    </table>
    <![endif]-->

    <!--[if !mso 9]><!-->
    <table class="lookout" border="1" cellpadding="0" cellspacing="0" align="center" style="max-width: 600px; width: 100%; height: auto; font-size:1em;">
        <tbody>
            <tr>
                <td>Increasing Sales everywhere else</td>
            </tr>
        </tbody>
    </table>
    <!--<![endif]-->

答案 1 :(得分:0)

它显示边框和字体大小,因为底部表未被隐藏。此外,我大多数时候都使用这个术语:<!--[if (gte mso 9)|(IE)]>它似乎对大多数MSO客户端来说效果最好

答案 2 :(得分:0)

@Niklas和@Ted:非常感谢您的回复。

我做了另一次尝试,并按照你建议Ted的方式发送了电子邮件,但不幸的是边框和1em字体大小再次出现在Outlook 2013中。 我很想知道它发送的电子邮件客户端是否会影响它在以后查看的电子邮件客户端中的显示方式。我是从gmail发送的。我从浏览器中保存了html doc并将其复制到gmail。

这就是我复制的html文件的样子:

<html xmlns="http://www.w3.org/1999/xhtml">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
    <title>Outlook conditional comments</title>

    <meta charset="ISO-8859-1">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keywords" content="">

</head>

    <body>
    <!--[if gte mso 9]>
    <table class="lookout" border="0" cellpadding="0" cellspacing="0" align="left" style="max-width: 600px;
    width: 100%; height: auto; font-size:3em;"> <tbody> <tr> <td>Increasing sales 13</td> </tr> </tbody> </table>
    <![endif]-->

    <!--[if !mso 9]>      <!-->
        <table class="lookout" border="1" cellpadding="0" cellspacing="0" align="center" style="max-width: 600px; width: 100%; height: auto; font-size:1em;">
            <tbody>
                <tr>
                    <td>Increasing Sales everwhere else</td>
                </tr>
            </tbody>
        </table>
     <!--<![endif]-->
</body>
</html>

对新代码的任何想法或评论都非常感谢。

丹尼尔