我正在设计一个新的电子邮件签名,每次我从 Apple Mail 中转发或回复该电子邮件时,它都会变成蓝色。
我可以在苹果邮件中看到它是蓝色的,但在 f.i. 中也可以看到它。在 Gmail 中。因此,这不是 Apple Mail 显示蓝色链接的问题,而是使其变成蓝色的问题。
这是一个示例代码,已内联并格式化以提高可读性。
<p style="font-size: 15px; line-height: 18px;">
<a
href="http://example.com"
x-apple-data-detectors="true"
style="font-size: 15px;
line-height: 18px;
color: #000000 !important;
text-decoration: underline !important;
text-decoration-color: #000000 !important;
pointer-events: visible;">
www.example.com
</a>
</p>
到目前为止我尝试过的:
spans
标签周围和内部创建 a
。x-apple-data-detectors
设置为 true 和 false<meta content="email=no" name="format-detection">
也适用于其他链接类型我找不到太多关于
x-apple-data-detectors
的信息,想知道是否有更好的方法来调试它们。
非常感谢帮助。
尝试了上述所有步骤后仍然一无所获。作为一个可怕的解决方法,我发现添加引用“#”的链接将覆盖蓝色文本。
<a target="_blank" class="bluelinks" style="font-size: 16px; color: rgb(0, 0, 0); text-decoration: none;" href="#">before midnight on July 4th</a>
代码是否有可能在链接上处于活动状态? 您是否尝试过在活动状态下设置颜色?
我在一些 HTML 电子邮件的 CSS 中遇到过这种情况。这似乎是其他人解决这个问题的方法。
[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; }
我无法访问测试此功能所需的Apple软件,因此我只是将其作为我尚未测试过的想法来分享。
尝试将其添加到您的
<head>
:
<style type="text/css">
.appleLinksBlack a {
color: #000000!important;
text-decoration: underline!important;
}
</style>
然后在
<a>
的父级上使用该类,例如:
<p class="appleLinksBlack" style="font-size: 15px; line-height: 18px;">
我花了一个小时解决这个问题,刚刚发现Mac上的苹果邮件只是将#000000链接更改为蓝色。如果您使用其他颜色(例如不同的深色,如#1C1C1C),您将在回复中保留颜色!