How to Add Telephone Links in HTML
Table of Contents
In HTML, you can add telephone links on your page which allows the user to click/tap on it and then call the number.
This works because the browser will be able to read that the link is a telephone number and then launch the native telephone app on the device.
In this post, we'll learn how to add a telephone link in HTML.
Adding a Telephone Link in HTML
Adding a telephone link in HTML is the same process as adding any other link.
First you start off with your anchor tag.
HTML<a href="">
123-456-7890
</a>
As the href
attribute, you can use a telephone number, preceded by the tel:
protocol.
That looks like this:
HTML<a href="tel:123-456-7890">
123-456-7890
</a>
You can also add a country code to the telephone number:
HTML<a href="tel:+1-123-456-7890">
+1-123-456-7890
</a>
Try it out yourself:
- HTML
Conclusion
In this post, we've seen how you can add telephone links in HTML.
Telephone links are useful as they help save your users time as all they need to do is click on it to initiate a call.
Hopefully, this has been helpful to you.
Happy coding!
- Getting Started with TypeScript
- Getting Started with Solid
- Create an RSS Reader in Node
- Git Tutorial: Learn how to use Version Control
- How to Serve Static Files with Nginx and Docker
- How to build a Discord bot using TypeScript
- How to deploy a Node app using Docker
- How to Scrape the Web using Node.js and Puppeteer
- Getting User Location using JavaScript's Geolocation API
- Getting Started with Moment.js
- Learn how to build a Slack Bot using Node.js
- Setting Up a Local Web Server using Node.js