How To Add Telephone Links With HTML - W3docs
Có thể bạn quan tâm
Solution with tel:
Telephone links are the ones that you tap to call a number on phone-capable devices. Of course, some devices are able to recognize phone numbers and provide the linking automatically, but it’s not always so.
In the example below, we use :tel within the HTML <a> tag. Note that tel: is much like a protocol, and not a feature.
Example of adding a telephone link:
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <a href="tel:+05890000111">0-589-0000111</a> </body> </html> Try it Yourself »Result
0-589-0000111There isn’t any documentation (official) on this protocol handler for links. That’s why there can be differences in browser support and behavior. Commonly, browsers make different decisions on determining what to do with the clicked link. Also note that we included the exact telephone number inside the href attribute, but the number shown to the user is the one between the a tags. So we can show numbers in any form/style, and also we can use white-space between the digits
Styling telephone links
You can use a little CSS to style your telephone link. Let’s see an example where we add color to our link with the CSS color property.
Example of adding color to the telephone link:
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> a { color: #ff2121; text-decoration: none; } </style> </head> <body> <a href="tel:+05890000111">0-589-0000111</a> </body> </html> Try it Yourself »In our next example, we’ll add a phone character before the telephone number with the CSS ::before pseudo-element and content property.
Example of adding a phone character before the telephone link:
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> a[href^="tel:"]:before { content: "\260e"; margin-right: 10px; } </style> </head> <body> <a href="tel:+05890000111">0-589-0000111</a> </body> </html> Try it Yourself »Từ khóa » Html A Tel Format
-
Telephone Links: How To Add “Call-able” Links & CTA's To Your ...
-
How To Use An HTML Clickable Phone Number The Right Way
-
- HTML: HyperText Markup Language | MDN"> - HTML: HyperText Markup Language | MDN
-
Href="tel:" And Mobile Numbers - Html - Stack Overflow
-
HTML Input Type="tel" - W3Schools
-
4 Steps To Add A Clickable Telephone Link In HTML - HubSpot Blog
-
The Current State Of Telephone Links | CSS-Tricks
-
How To Build International Phone Number Input In HTML And ... - Twilio
-
How To Create A Click To Call Link Using HTML And In WordPress
-
Tel Link In Html Code Example
-
Html Code For Phone Number Format Code Example - Code Grepper
-
Create Phone Number Links In HTML | Delft Stack
-
How To Create A Telephone Input Field In HTML5 - HTML Form Guide
-
Make Phone Numbers Clickable (and Trackable!) On Mobile