ArticleDirectory
- How do I disable automatic detection of phone numbers in webpages?
During the test, Safari on the iPad always recognizes long numbers as phone numbers, turns the text into blue, and then adds a menu to the address book.
The layout would be quite disgusting if a number appears in the user name (the user name registered on Sina Weibo via mobile phone is "mobile phone user XXXXXXXX.
After testing, the long string number in the tag will not be recognized as a phone number, so a non-action a tag is embedded in the user name but there is no link, which temporarily solves this problem.
But this adds additional labels,CodeThe semantics of this method becomes very poor, and this method cannot be used for large text segments.
Today, I accidentally bumped into the official safari website and found that safari has a private meta attribute to solve this problem:
<MetaName= "Format-detection"Content= "Telephone = No" />
The official website is described as follows:
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 shocould not be automatically detected as phone numbers, you can choose to disable this feature on the entire page by addingMeta
Tag shown inListing 12.