问题描述
为移动设备上的用户创建可点击的超链接以拨打电话号码的正确通用格式是什么?
What is the proper, universal format for creating a clickable hyperlink for users on mobile devices to call a phone number?
带破折号的区号
<a href="tel:555-555-1212">555-555-1212</a>
没有破折号的区号
<a href="tel:5555551212">555-555-1212</a>
带破折号和 1 的区号
Area code with dashes and 1
<a href="tel:1-555-555-1212">555-555-1212</a>
没有破折号和 1 的区号
Area code with no dashes and 1
<a href="tel:15555551212">555-555-1212</a>
带破折号、1 和 + 号的区号
Area code with dashes, 1 and + sign
<a href="tel:+1-555-555-1212">555-555-1212</a>
不带破折号、1 和 + 号的区号
Area code with no dashes, 1 and + sign
<a href="tel:+15555551212">555-555-1212</a>
推荐答案
破折号 (-
) 除了使数字更具可读性之外没有任何意义,因此您不妨包含它们.
Dashes (-
) have no significance other than making the number more readable, so you might as well include them.
由于我们永远不知道网站访问者来自哪里,因此我们需要让电话号码可以从世界任何地方拨打.因此,+
符号总是必要的.+
符号由您的移动运营商自动转换为您的国际拨号前缀,也称为退出代码".此代码因地区、国家/地区而异,有时一个国家/地区可以使用多个代码,具体取决于运营商.幸运的是,当是本地电话时,使用国际格式拨打仍然可以.
Since we never know where our website visitors are coming from, we need to make phone numbers callable from anywhere in the world. For this reason the +
sign is always necessary. The +
sign is automatically converted by your mobile carrier to your international dialing prefix, also known as "exit code". This code varies by region, country, and sometimes a single country can use multiple codes, depending on the carrier. Fortunately, when it is a local call, dialing it with the international format will still work.
使用您的示例号码,从中国拨打电话时,人们需要拨打:
Using your example number, when calling from China, people would need to dial:
00-1-555-555-1212
从俄罗斯,他们会拨打
810-1-555-555-1212
+
符号通过允许您省略国际拨号前缀来解决此问题.
The +
sign solves this issue by allowing you to omit the international dialing prefix.
在国际拨号前缀之后是 国家代码,然后是地理代码(区号),最后是本地电话号码.
After the international dialing prefix comes the country code, followed by the geographic code (area code), finally the local phone number.
因此,您的最后两个示例中的任何一个都可以使用,但我的建议是使用这种格式以提高可读性:
Therefore either of the last two of your examples would work, but my recommendation is to use this format for readability:
<a href="tel:+1-555-555-1212">+1-555-555-1212</a>
注意:对于包含与中继前缀不同的号码国家/地区代码(例如,如果您在本地使用 0
括号括起来编写它),则需要省略它,因为数字必须采用国际格式.
Note: For numbers that contain a trunk prefix different from the country code (e.g. if you write it locally with brackets around a 0
), you need to omit it because the number must be in international format.
这篇关于如何创建超链接以在移动设备上拨打电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!