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

问题描述 投票:5回答:2

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

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

在我的iPhone 7上,Sleigh Bells是一个可点击的链接,可以显示底部的建议。

我试过用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;
}

只是将文本的样式设置为不像链接,但它仍然是可点击的。

我也尝试添加以下行: -

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

但到目前为止,我还没有找到办法让这个词/短语不可点击,任何人都有任何想法?

enter image description here

ios css html5 html-email
2个回答
4
投票

根据我上面的评论(我没有对此进行过测试,但确认OP已经确认),在元素中添加以下CSS样式可以禁用iOS设备上的链接点击行为。

pointer-events: none;

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

[x-apple-data-detectors]


1
投票

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

在Gmail中,即使安装了Apple Data检测器,此电话号码也会显示蓝色下划线并变为蓝色。此外,Windows 10 Mail在星期一下面放置一条黑色虚线:

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

我添加了&zwnj;,一个非打印字符到800号码和星期一。我把&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 Data Detection的方式:

<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>

我希望这有助于其他人面临电话号码和日期的数据检测问题。

祝好运。

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