我有一个 HTML,其中包含一个带有电话号码的简单段落,但在我的 iOS 测试中,电话号码改变了颜色并转换为电话号码。 转换为电话不会打扰我,但字体颜色的变化是。 如何避免?
这是我的代码示例:
<p class="phone-pink">call 1-888-4HELP <br class="show-for-small-only">(1-888-443-57)</p>
最佳答案
将此添加到您的 html 的头部:
<meta name="format-detection" content="telephone=no">
如上所述,您可以设置链接标签的样式,但如果您只想影响那一行,请执行以下操作:
.phone-pink a[href^=tel] {
color : inherit;
text-decoration: none;
}
然后您可以将其更改为一个 id:
<p id="phone-pink">call 1-888-4HELP <br class="show-for-small-only">(1-888-443-57)</p>
和CSS:
#phone-pink a[href^=tel] {
color : inherit;
text-decoration: none;
}
查看这些答案以获取更多信息:
How do I remove the blue styling of telephone numbers on iPhone/iOS?
关于html - 防止手机变色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45329808/