1. The standard phone number format is as follows: <a href="tel:1-408-555-5555">1-408-555-5555</a>, the phone function will be automatically opened after clicking;
2. But sometimes numbers that are not phone numbers are automatically parsed as phone numbers by the browser, and the color and style of the numbers are changed;
3. If you ignore the numbers in the page and identify them as phone numbers, just turn off this default behavior, just one line of code:
- <meta name = "format-detection" content = "telephone=no">
4. This closure will not affect the identification of the real phone number;
illustrate:
Disable the phone function for numbers when the device is browsing the web (different devices have different interpretations, iTouch clicks a number to save a contact, iPhone makes a call), and ignores the number in the page to be recognized as a phone number.
If you need to enable the phone function, you can set telephone=yes. If there are links to Google Maps, iTunes and YouTube on the page, the corresponding program components will be opened on the ios device.
Note: The above methods are all for iOS devices, how about Android devices?
The format-detection attribute and meaning in the Meta tag
The translation of format-detection into Chinese means "format detection". As the name suggests, it is used to detect some formats in html. The format-detection attribute of meta mainly has the following settings:- <meta name="format-detection" content="telephone=no">
- <meta name="format-detection" content="email=no">
- <meta name="format-detection" content="adress=no">
- <meta name="format-detection" content="telephone=no,email=no,adress=no">
You clearly wrote a string of numbers without a link style, and the iPhone will automatically add a link style to your text, and click the number to automatically dial! How to remove this dial-up link? At this time, our meta should show its magic again. The code is as follows:
telephone=no prohibits converting numbers into dial-up links!
telephone=yes will turn on the conversion of numbers into dial-up links. To turn on the conversion function, this meta need not be written. It is turned on by default!
2. Email
Tell the device not to recognize the mailbox and not send it automatically after clicking
email=no is forbidden as an email address!
Email=yes is turned on and the text is defaulted to the email address, so this meta does not need to be written, it is turned on by default!
Three, adress
adress=no forbids jumping to the map!
adress=yes enables the function of clicking on the address to jump directly to the map, which is enabled by default!