Reputation: 97
I am trying to hyperlink a number (international phone number) on my HTML webpage.
I've looked at tons of other examples online, and mine looks exactly the same so I'm not sure why it's not working :(
<a href="tel:+44 20 7123 4567">+44 20 7123 4567</a>
and here is my error message
Upvotes: 6
Views: 13074
Reputation:
HREF links can’t contain spaces.
So your code will look like:
<a href="tel:+442071234567">+44 20 7123 4567</a>
Upvotes: 8
Reputation: 1987
Remove the space between the numbers in your html. For example: <a href="tel:+442071234567">+44 20 7123 4567</a>
.
Upvotes: 0
Reputation: 155145
Hyperlinks (the URI in href=""
) cannot contain spaces. Fortunately E.123 and E.164 (the international phone number standards) do not require spaces or formatting characters either.
You have two options:
Use URI-encoded spaces %20
:
<a href="tel:+44%2020%207123%204567">+44 20 7123 4567</a>
Remove spaces:
<a href="tel:+442071234567">+44 20 7123 4567</a>
I prefer #2 because it makes it easier to see the real digits because %20
contains digits.
Upvotes: 1