Search code examples
html

Can a HTML telephone link accept spaces in the value?


Is there anything wrong or problematic with including spaces as well as a plus symbol (for the international code) in a telephone link? Example:

<a href="tel:+46 000 00 00 00">+46 000 00 00 00</a>

(I replaced the actual number I want to use with 0s here)


Solution

  • HTML is irrelevant here. A URL is a URL no matter where you put it.

    The relevant spec says:

    even though ITU-T E.123 [E.123] recommends the use of space characters as visual separators in printed telephone numbers, "tel" URIs MUST NOT use spaces in visual separators to avoid excessive escaping.

    So "no".

    Even if a space was allowed, the general rules for URLs would mean that you would have to replace it with %20 (hence the comment about excessive escaping).