防止在iOS设备中的Safari将数字识别为电话号码
2013-11-24 12:48
459 查看
在测试中发现iPad上的Safari总会把长串数字识别为电话号码,文字变成蓝色,点击还会弹出菜单添加到通讯录。
别的地方倒也罢了,如果在用户名中出现数字(手机注册新浪微博的话用户名就是“手机用户xxxxxxxx”),版式会很恶心。
经过测试在a标签中的长串数字不会识别为电话,于是给出现用户名但没有链接的地方嵌套一个无动作的a标签,临时解决了这个问题。
但是这样增加了额外的标签,代码的语义性变得很差,而且对大段文字不能用这个方法。
今天无意中撞进Safari的官网,发现了safari有个私有meta属性可以解决这个问题:
<meta name="format-detection" content="telephone=no" />
官网的说明如下: How do I disable automatic detection of phone numbers in webpages? In Safari on iPhone, phone numbers are automatically detected and transformed into links that dial the phone number when tapped. If you have strings of numbers in your webpage that should not be automatically detected as phone numbers, you can choose to disable this feature on the entire page by adding the meta tag shown in Listing 12.
别的地方倒也罢了,如果在用户名中出现数字(手机注册新浪微博的话用户名就是“手机用户xxxxxxxx”),版式会很恶心。
经过测试在a标签中的长串数字不会识别为电话,于是给出现用户名但没有链接的地方嵌套一个无动作的a标签,临时解决了这个问题。
但是这样增加了额外的标签,代码的语义性变得很差,而且对大段文字不能用这个方法。
今天无意中撞进Safari的官网,发现了safari有个私有meta属性可以解决这个问题:
<meta name="format-detection" content="telephone=no" />
官网的说明如下: How do I disable automatic detection of phone numbers in webpages? In Safari on iPhone, phone numbers are automatically detected and transformed into links that dial the phone number when tapped. If you have strings of numbers in your webpage that should not be automatically detected as phone numbers, you can choose to disable this feature on the entire page by adding the meta tag shown in Listing 12.
相关文章推荐
- 防止在iOS设备中的Safari将数字识别为电话号码
- 防止在iOS设备中的Safari将数字识别为电话号码
- 防止在iOS设备中的Safari将数字识别为电话号码
- 防止在iOS设备中的Safari将数字识别为电话号码
- 防止在iOS设备中的Safari将数字识别为电话号码
- html防止iOS将数字识别为电话号码
- 如何防止iOS网页中的数字被识别为电话号码
- [置顶] H5页面在iOS网页中的数字被识别为电话号码(数字颜色自动被改变成蓝色)?
- 禁止苹果浏览器Safari将数字识别成电话号码的方法
- ios 禁止将页面中的一连串数字识别为电话号码
- 禁用IOS设备页面数字自动识别为手机号
- 禁止Safari将数字识别成电话号码,增加特殊效果
- 禁止 IOS 系统 数字 变超链 (自动识别为电话号码)
- 告诉设备忽略将页面中的数字识别为电话号码
- 微信企业号让IOS不要识别数字为电话号码的方法
- 禁止iOS 设备中safai浏览器将数字识别成电话
- 禁止苹果浏览器Safari将数字识别成电话号码的方法
- IPad iOS开发基础——ipad设备方向识别
- [Phonegap+Sencha Touch] 移动开发27、禁用iOS系统的webapp电话号码自动识别
- 屏蔽ios点击非电话号码的数字串打电话功能