电话格式的 HTML 电话链接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16242590/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 07:54:56  来源:igfitidea点击:

HTML telephone link for phones format

html

提问by user654936

I am making an html link for a phone.

我正在为手机制作 html 链接。

This is what I have:

这就是我所拥有的:

<a href="tel:1-888-888-8888"> 1-888-888-8888</a>

Will phones recognize this, or do I need to change it to:

手机会识别出这一点,还是我需要将其更改为:

<a href="tel:18888888888"> 1-888-888-8888</a>

回答by Nate Hekman

Visual separators (except for spaces) are allowed in the uri.

uri 中允许使用视觉分隔符(空格除外)。

From RFC 3966 "The tel URI for Telephone Numbers":

来自RFC 3966“电话号码的 tel URI”

5.1.1. Separators in Phone Numbers

Phone numbers MAY contain visual separators. Visual separators ('visual-separator') merely aid readability and are not used for URI comparison or placing a call ... "tel" URIs MUST NOT use spaces in visual separators ...

5.1.1. 电话号码中的分隔符

电话号码可能包含视觉分隔符。视觉分隔符 ('visual-separator') 仅有助于提高可读性,不用于 URI 比较或拨打电话……“tel” URI 不得在视觉分隔符中使用空格……