Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Telephone links are a thing. Like an anchor link you tap to (probably) go to another page, these are links you tap to call a number on a phone-capable device. They’ve been around for quite some time. Yet, they cause me a lot of confusion. For example, many devices will automagically recognize phone numbers and do the linking for us, but not always.

...

We have a snippet for phone links on this site that’s been hanging around since 2011:

 

Code Block
languagexml
<a href="tel:1-562-867-5309">1-562-867-5309</a>

This also works on text links:<a

 

Code Block
languagexml
<a href="tel:1-562-867-5309"

...

>Click to Call!</

...

a>

tel: is not so much a feature as it is a protocol, much in the same way thathttp: and mailto: are protocols for the <a> tag feature. The spec itself has nothing to say about it, though HMTL5 did provide support for custom protocol handlers, which allow such a protocol to be used.

 

You’re probably wondering why tel: can be considered default usage in the absence of an official spec on it. You can credit this to the fact that it was a proposed standard as far back as 2000 and later adopted by iOS, making it the de facto way to go by roughly 2007. There are other phone-based protocols (which we’ll get to later), but we’ll be focusing on tel: given its relative prominence. 

...

...

https://css-tricks.com/the-current-state-of-telephone-links/

...