The customer is asked to make the phones in the contacts section, as links; especially important for the iPhone;

but now I caught a bug on Androyd: he perceived hyphens in the number as symbols and cut the ending !!!

<a href="tel:7-812-643-21-71">7-812-643-21-71</a> 

ps numbers were originally given "beautiful" and are derived according to the principle of <a href="tel: $param">$param</a> task is to keep it as readable as possible!

  • Is it not simpler to cut everything in the attribute except digits? - user207618
  • And why do you use delimiters in href ? - Pyramidhead
  • the data on the website appear both in contacts and on the geo-map, we thought: what is enough to register with a dash ... it's not a fact that they want to be joined together! SSMaker.ru/45e6f1e7 - user1781165

3 answers 3

Write like this

 <a href="tel:+78126432171">+7 (812) 643-21-71</a> 

Only numbers in href

  • the data on the website appear both in contacts and on the geo-map, we thought: what is enough to register with a dash ... it's not a fact that they want to be joined together! SSMaker.ru/45e6f1e7 - user1781165
  • @ user1781165 so what's the problem to write in href together, and in the body of the link on the map with hyphens? - Vadim Leshkevich
  • @ user1781165 actually, at the top, in the header on the site, that you have thrown off the example and it is done - Vadim Leshkevich
  • one
    in href only in international format with a plus. Inside <a> </a>, shove what you want and how you want, even in <span>, wrap it around to jump the numbers - hardworm

There is a whole standard https://tools.ietf.org/html/rfc2806 . But the best design recommended

 <a href="tel:+78126432171">код(812) 643-21-71 и что вздумается</a> 

The phone in href must be in the international format with a plus. In <a></a> anything you like. Make out at least in <span> and <div> for setting styles.

    Experimentally calculated that Androyd can take two hyphens and score the number <a href="tel:7812-64321-71">7812-64321-71</a>

    • four
      What's the point? Why is it that prevents to write in href without hyphens? Explain, we are all interested) - Vadim Leshkevich
    • The numbers were originally given "beautiful" and are derived according to the principle <a href="tel: $param"> $ param </a> the task is to keep it as readable as possible! - user1781165
    • people from where cons? I alone answered my question! - user1781165
    • Cons from there, that you did not answer the question, but were engaged in meaningless nonsense. Everything could be made simpler and more correct, what is the problem with cutting out everything except numbers with a regular schedule and substituting it in the href , and substituting the original $param in the link body? - Vadim Leshkevich
    • @ user1781165 Vadim correctly noticed. This is not the answer to the question, but the bicycle. And we started it because, as a solution, we cannot recommend bicycles to other people who, through a search, will get to your question. There is a format for specifying numbers inside the href, which most developers adhere to, and which ensures maximum compatibility with all devices. What is the difference, it looks beautiful in the attribute or not? Nobody will see it anyway. And the phone itself will format the number when you click on it. And inside <a> you can write it down as you please, even in Roman numerals. - neluzhin