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 Telephone Links
-
Telephone Links: How To Add “Call-able” Links & CTA's To Your ...
-
4 Steps To Add A Clickable Telephone Link In HTML - HubSpot Blog
-
Tel - Tryit Editor V3.7
-
How To Use An HTML Clickable Phone Number The Right Way
-
How To Create A Click To Call Link Using HTML And In WordPress
-
The Current State Of Telephone Links | CSS-Tricks
-
How To Trigger A Phone Call When Clicking A Link In A Web Page On ...
-
Create Phone Number Links In HTML | Delft Stack
-
Tel Link In Html Code Example
-
Adding HTML Telephone Links And Iphone Text Number
-
Hyperlink Phone Numbers With Anchor Tags - Martech Zone
-
Phone Links - Apple Developer
-
How To Make A Call-able Link Using HTML ? - GeeksforGeeks
-
Add Telephone Number Links With HTML5 - Paulund