3

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

enter image description here

thtcurlygirl
  • 67
  • 2
  • 6

3 Answers3

6

HREF links can’t contain spaces.

So your code will look like:

<a href="tel:+442071234567">+44 20 7123 4567</a>
0

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:

  1. Use URI-encoded spaces %20:

    <a href="tel:+44%2020%207123%204567">+44 20 7123 4567</a>
    
  2. 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.

Dai
  • 141,631
  • 28
  • 261
  • 374
0

Remove the space between the numbers in your html. For example: <a href="tel:+442071234567">+44 20 7123 4567</a>.

devmike01
  • 1,971
  • 1
  • 20
  • 30