【问题标题】:why gmail is rendering outlook html为什么gmail呈现outlook html
【发布时间】:2021-01-22 02:25:39
【问题描述】:

<html xmlns:v="urn:schemas-microsoft-com:vml">

<body>
    <table width="600" border="1" cellpadding="5">
        <tbody>
            <tr>
                <td colspan="1">qnty</td>
                <td colspan="2">price</td>
            </tr>
            <tr>
                <td colspan="1">100</td>
                <td colspan="1">
                    <!--[if mso]>
                        <span style="position: relative;color: black;">
                            $7.75
                            <v:rect stroke="f" fill="t" fillcolor="red" style="width: 40px; height: 1px; position: absolute; left: 0px;top: 8px"></v:rect>
                        </span>
                    <![endif]-->
                    <!--[if !mso]>
                        <span style="position: relative;color: black;">
                            $1232
                            <v:rect stroke="f" fill="t" fillcolor="red" style="width: 40px; height: 1px; position: absolute; left: 0px;top: 8px"></v:rect>
                        </span>
                    <![endif]-->

                </td>
                <td colspan="1">0.25</td>
            </tr>
        </tbody>
    </table>

</body>

</html>

我正在使用上面的 HTML 在 Outlook 中显示价格 7.75,在 GMAL 等其他电子邮件中显示 1232。该代码在 Outlook 上运行良好,但在 Gmail 上显示相同的结果。

Gmail

展望

【问题讨论】:

  • 这能回答你的问题吗? HTML Emails: fallback for mso conditional?
  • 从您的屏幕截图看来您正在查看 Outlook 中的两封电子邮件?要使代码生效,您需要在 Outlook(桌面)和 Gmail(网络浏览器)中签入。
  • @Syfer 我已经更新了图片。是我上传错了。
  • @KenY-N 与 gmail 显示的价格不完全一样,outlook 可以检查更新的图像

标签: html email html-email


【解决方案1】:

您的!mso 条件注释似乎不正确。从 Outlook 隐藏内容并使其在其他地方可见的正确格式是:

<!--[if !mso]><!-->
<span style="position: relative;color: black;">
    $1232
    <v:rect stroke="f" fill="t" fillcolor="red" style="width: 40px; height: 1px; position: absolute; left: 0px;top: 8px"></v:rect>
</span>
<!--<![endif]-->

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 2013-09-08
    • 2022-01-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多