HTML邮件前头不隐藏

问题描述 投票:0回答:1

我在我的HTML邮件中添加了一个前头文字,但在Outlook中并没有隐藏。我将前头样式添加为内联样式,也将其包含在头部样式标签中。

<!doctype html>
<html>
<head>
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{% block title %}{% endblock %}</title>
    <style>
        .preheader {
            color: #f6f6f6;
            display: none !important;
            max-height: 0;
            max-width: 0;
            opacity: 0;
            visibility: hidden;
            mso-hide: all;
            overflow: hidden;
            font-size: 0;
            line-height: 1px;
        }
    </style>
</head>
<body style="background-color: #f6f6f6; font-family: 'Verdana', sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 10px; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
    <div class="preheader" style="color: #f6f6f6; display: none !important; max-height: 0; max-width: 0; opacity: 0; visibility: hidden; mso-hide: all; overflow: hidden; font-size: 0; line-height: 1px;">
        {% block preheader %}{% endblock %}
    </div>

    ...

为什么前头没有被隐藏?它一直在渲染,好像没有应用任何样式。

先谢谢你

outlook html-email
1个回答
0
投票

很明显,前头的内容太长了。限制字符数后,我的问题就解决了。

© www.soinside.com 2019 - 2024. All rights reserved.