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

时间:2017-12-13 11:40:56

标签: ios css html5 html-email

我不确定我是否正在搜索正确的内容,但在我发送的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

2 个答案:

答案 0 :(得分:4)

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

pointer-events: none;

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

[x-apple-data-detectors]

答案 1 :(得分: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邮件将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>

我希望通过电话号码和日期帮助其他人面对数据检测问题。

祝你好运。