HTML5 电子邮件 - iOS - 禁用单词建议?

HTML5 Emails - iOS - Disable word suggestion?

我不确定我是否正在搜索正确的东西,但在我发送的 HTML5 电子邮件中,我有以下行:-

<h3>IS THAT THE SOUND OF SLEIGH BELLS?</h3>

在我的 iPhone 7 Sleigh Bells 上有一个可点击的 link,它会显示类似底部的建议。

我尝试用 span 标签包装 h3,我添加了以下 CSS:-

[x-apple-data-detectors] {
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}

这只是将文本样式设置为看起来不像 link 但它仍然可以点击。

我也尝试添加以下行:-

<tag autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>

但到目前为止,我还没有设法让这个 word/phrase 不可点击,有人知道吗?

根据我上面的评论(我没有测试过,但 OP 确认它可以工作),将以下 CSS 样式添加到元素可以禁用 link 点击行为iOS 台设备。

pointer-events: none;

这可能必须通过问题中提到的 iOS-特定 CSS 规则添加:

[x-apple-data-detectors]

我知道这个答案已经解决了,但我想为其他在数据检测器、Gmail 和 Windows 10 Mail 方面有问题的电子邮件客户端提供修复。

在 Gmail 中,这个 phone 号码带有蓝色下划线并变为蓝色,即使 Apple 数据检测器修复到位也是如此。此外,Windows 10 Mail 在 Monday 一词下方放置了一条黑色虚线:

800-422-4234 Monday through Friday, 8 a.m. to 9 p.m. Eastern Time.

我在 800 号码和 Monday 一词中添加了 &zwnj;,一个非打印字符。我将 &zwnj; 放在 Mo 之后,因为 Mon Windows 10 Mail 将 Mon 识别为星期一的缩写,并在 Mon 下划线。

800-422-42&zwnj;34 Mo&zwnj;nday through Friday, 8 a.m. to 9 p.m. Eastern Time.

这修复了 Gmail 的数据检测,并修复了 Windows 10 Mail 中的 Monday 问题,但随后它会在 Friday 一词下划线。所以我做了同样的修复:

800-422-42&zwnj;34 Mo&zwnj;nday through Fr&zwnj;iday, 8 a.m. to 9 p.m. Eastern Time.

这修复了我测试的每个主要电子邮件客户端中的数据检测问题。这就是我使用 Apple 数据检测的方式:

<style>
  [x-apple-data-detectors] {
  color: inherit !important;
  text-decoration: none !important;
  font-size: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
}
</style>

我希望这可以帮助其他面临 phone 数字和日期数据检测问题的人。

祝你好运。