iPhone上的Safari会自动为出现在电话号码中的数字字符串创建链接。我正在编写一个包含IP地址的网页,Safari将其转换为电话号码链接。是否可以为整个页面或页面上的某个元素禁用此行为?


当前回答

I too have this problem: Safari and other mobile browsers transform the VAT IDs into phone numbers. So I want a clean method to avoid it on a single element, not the whole page (or site). I'm sharing a possible solution I found, it is suboptimal but still it is pretty viable: I put, inside the number I don't want to become a tel: link, the ⁠ HTML entity which is the Word-Joiner invisible character. I tried to stay more semantic (well, at least a sort of) by putting this char in some meaning spot, e.g. for the VAT ID I chose to put it between the different groups of digit according to its format so for an Italian VAT I wrote: 0613605⁠048⁠8 which renders in 0613605⁠048⁠8 and it is not transformed in a telephone number.

其他回答

加上这个,我想这就是你想要的:

<meta name = "format-detection" content = "telephone=no">

I too have this problem: Safari and other mobile browsers transform the VAT IDs into phone numbers. So I want a clean method to avoid it on a single element, not the whole page (or site). I'm sharing a possible solution I found, it is suboptimal but still it is pretty viable: I put, inside the number I don't want to become a tel: link, the &#8288; HTML entity which is the Word-Joiner invisible character. I tried to stay more semantic (well, at least a sort of) by putting this char in some meaning spot, e.g. for the VAT ID I chose to put it between the different groups of digit according to its format so for an Italian VAT I wrote: 0613605&#8288;048&#8288;8 which renders in 0613605⁠048⁠8 and it is not transformed in a telephone number.

添加元标记来关闭格式检测对我来说不起作用。我试图在<p>标签和其他文本中显示缩放会议ID, iOS将该ID转换为电话链接。此外,我通过一个[href^="tel:"]定位电话链接,以便给他们自定义样式,因此禁用电话链接上的样式不是一个选项。

我找到的解决方案是将ID号包装在<code>标记中。这似乎可以防止iOS干扰它。

我有一个ABN(澳大利亚商业号码),iPad Safari坚持要把它变成一个电话号码链接。这些建议都没用。我的解决方案是在数字之间加上img标签。

ABN 98<img class="PreventSafariFromTurningIntoLink" /> 009<img /> 675<img /> 709

该类的存在只是为了记录img标记的用途。

适用于iPad 1(4.3.1)和iPad 2(4.3.3)。

你可以尝试将它们编码为HTML实体:

&#48; = 0
&#57; = 9