iPhone上的Safari会自动为出现在电话号码中的数字字符串创建链接。我正在编写一个包含IP地址的网页,Safari将其转换为电话号码链接。是否可以为整个页面或页面上的某个元素禁用此行为?
当前回答
你可以尝试将它们编码为HTML实体:
0 = 0
9 = 9
其他回答
我使用的一个不仅适用于Mobile Safari的技巧是使用HTML转义码和在电话号码中添加一点标记。这使得浏览器更难“识别”一个电话号码。
Phone: 1-800<span>-</span>620<span>-</span>3803
我使用零宽度细木工‍
把这句话放在电话号码里就行了。在BrowserStack(和Litmus用于电子邮件)中测试。
你可以尝试将它们编码为HTML实体:
0 = 0
9 = 9
截至2012年6月13日,这个答案胜过一切:
<a href="#" style="color: #666666;
text-decoration: none;
pointer-events: none;">
Boca Raton, FL 33487
</a>
将颜色更改为与文本匹配的颜色,文本装饰删除下划线,指针事件阻止它像浏览器中的链接一样被查看(指针不会更改为手)
这是完美的HTML电子邮件在ios和浏览器。
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 06136050488 and it is not transformed in a telephone number.
推荐文章
- 如何使用Xcode创建。ipa文件?
- Xcode 4 -在新的Macintosh安装上的配置文件上“没有找到有效的签名标识”错误
- 在iPhone上确定用户是否启用了推送通知
- 是否有可能禁用浮动头在UITableView与UITableViewStylePlain?
- Swift -转换为绝对值
- 在代码中为UIButton设置一个图像
- 如何修复UITableView分隔符在iOS 7?
- 在Swift中根据字符串计算UILabel的大小
- 如何调用手势点击在UIView编程在迅速
- 我如何隐藏在一个Swift iOS应用程序的状态栏?
- 对于实例消息,接收方类型***是转发声明
- 如果模态ViewController演示样式为UIModalPresentationFormSheet, iPad键盘将不会解散
- 在UITableView中检测哪个UIButton被按下了
- 我如何输入RGB值到接口生成器?
- NSUserDefaults -如何判断一个键是否存在