首页 > 解决方案 > 由于 HTML 签名,Apple 邮件背景为白色

问题描述

我已经在 HTML 中创建了一个电子邮件签名,并将它与 Mac 和 iPhone 上的本机 Apple Mail 应用程序一起使用。
我也在使用深色模式,但遗憾的是,如果我使用我的签名,我的电子邮件背景会变成白色。我测试了它,这是因为我在签名中包含了图像。

有什么办法可以防止 Apple Mail 显示白色背景?我希望背景变暗(就像纯文本电子邮件一样)。Apple Mail 设置中的“为邮件使用深色背景”选项已激活,并且在我的 HTML 代码中我没有定义背景颜色...</p>

我使用的是macOS Catalina 10.15.7并拥有Apple Mail 版本 13.4
这是我签名的HTML 代码(当然,我在这里发布的时候没有我的真实联系信息)。一切正常,只是背景是白色的。

<body><br /><br /><br />
<style type="text/css">
    :root {Color-scheme: light dark; supported-color-schemes:light dark;}
    a {margin:0; padding:0; border:none; text-decoration:none;}
    table, tr, td, a, span {font-family:"Helvetica Neue",Helvetica,Arial,sans-serif; font-size:15px;}
    img {border-radius: 50%;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="address=no" />
<meta name="format-detection" content="email=no" />
<meta name="color-scheme" content="light dark" />
<meta name="supported-color-schemes" content="light dark" />

<table width="320" cellspacing="0" cellpadding="0" border-spacing="0" style="width:85px; margin:0; padding:0;">
    <tr>
        <td valign="top" width="80" style="width:80px; margin:0; padding:0; vertical-align:top;">
            <img moz-do-not-send="true" src="URL OF IMAGE" alt="MY NAME" width="80" height="80" style="border:none; width:80px; height:80px; display:block; border-radius: 50%;">
        </td>
        <td width="10" style="width:10px; min-width:10px; max-width:10px; margin:0; padding:0;">
            &nbsp;
        </td>
        <td style="margin:0; padding:0;">
            <table cellspacing="0" cellpadding="0" border-spacing="0" style="padding:0; margin:0; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; mso-line-height-rule:exactly; line-height:25px; color:#b0b0b0; border-collapse:collapse; -webkit-text-size-adjust:none;">
                <tr style="margin:0; padding:0;">
                    <td style="margin:0; padding:0; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; white-space:nowrap;">
                        <b><span style="color:#0099cc;">MY NAME</span></b>
                    </td>
                </tr>
                <tr style="margin:0; padding:0;">
                    <td style="margin:0; padding:0; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; white-space:nowrap;">
                        <a href="mailto:MY EMAIL ADDRESS" style="border:none; text-decoration:none; color:#b0b0b0;"><span style="color:#b0b0b0">MY EMAIL ADDRESS</span></a>
                    </td>
                </tr>
                <tr style="margin:0; padding:0;">
                    <td style="margin:0; padding:0; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:15px; white-space:nowrap;">
                        <span style="color:#b0b0b0"><a href="https://www.example.com" style="border:none; text-decoration:none; color:#b0b0b0;">domain.com</a> &middot; <a href="https://www.linkedin.com" style="border:none; text-decoration:none; color:#b0b0b0;">LinkedIn</a></span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table><br />
&nbsp;
</body>

这是电子邮件签名的屏幕截图(出于隐私原因的黑框)。我一发送电子邮件或将其保存为草稿,电子邮件的背景就会变成白色。如果我稍后编辑草稿,背景将保持白色。 白色背景的电子邮件签名

谢谢您的回答!

标签: htmlcssmacosemailhtml-email

解决方案


我有同样的问题(或者至少听起来几乎相同),我认为只是解决了它。您是否让 Gmail 调整图像大小?比如,您选择“小”、“中”还是“大”尺寸?

我的解决方案是以我需要的确切分辨率上传图片,并强制 Gmail 向它们显示“原始”上传大小。现在背景在黑暗模式下再次显示为黑色,不需要额外的 html、css 等。这似乎是 Apple 的邮件应用程序和 Gmail 之间的图像调整大小的错误/问题。

我整晚都在拉头发,因为它肯定是通过添加图像触发的,而且我知道其他人也可以使用它。我搜索并发现除了你的线程之外什么都没有。但我终于让它工作了,我希望这也能解决你的问题!


推荐阅读