Brain Food for Web Developers


Adding HTML5 Telephone Numbers

Using the href attribute, HTML5 offers a way to add phone numbers as an anchor link in the same way you can link to a url. Clicking on the number on a smartphone will initiate a call.

Here’s an example:

<p>Call <a href="tel:+12095551234">555-1234</a></p>

Since your site can be viewed from any location you should include the international dialing prefix.

You can also add a extensions to the number by using a pause:

<p>Call <a href="tel:+12095551234p148">555-1234</a></p>

Tel or Skype

If you’d rather direct users to Skype you can use the callto: attribute like so:

<p>Call <a href="callto:+12095551234">555-1234</a></p>

Author: Graham

My name is Graham and I'm a Scottish web developer living in California. I love working with clean code to make attractive and usable websites. I'm also interested in cooking, gardening, and taekwondo.

Comments are closed.