Skip to content

Instantly share code, notes, and snippets.

@hsleonis
Last active June 20, 2022 15:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsleonis/7cd925725896c11ac0a4fa7fadae7c28 to your computer and use it in GitHub Desktop.
Save hsleonis/7cd925725896c11ac0a4fa7fadae7c28 to your computer and use it in GitHub Desktop.
Telephone and geo location map link in html
Telephone link:
(Reference: http://code.tutsplus.com/tutorials/mobile-web-quick-tip-phone-number-links--mobile-7667)
Android and iOS automatically detect phone numbers with specific format.
(555) 555-5555 (Android + iPhone)
555 555 5555 (Android + iPhone)
555.555.5555 (Android + iPhone)
<!-- Embedded within normal page text -->
<p>If you'd like to talk, <a href="tel:5555555">Call Me!</a></p>
<!-- Linking a custom image -->
<a href="tel://555-5555"><img src="phone.png" alt="Call Now!" /></a>
<!-- Cross-platform compatible (Android + iPhone) -->
<a href="tel://1-555-555-5555">+1 (555) 555-5555</a>
For IE:
(Reference: https://msdn.microsoft.com/en-us/library/dn265018%28v=vs.85%29.aspx)
* To enable the behavior for an element (and its child elements), set the x-ms-format-detection attribute to "phone" or "all".
<div x-ms-format-detection="phone">+555-555-555</div>
* To disable the behavior for an element (and its child elements), set the x-ms-format-detection attribute to "none".
<div x-ms-format-detection="none">+555-555-555</div>
* To disable the behavior for a webpage, use the meta element:
<meta name="format-detection" content="telephone=no"/>
GEO location link:
No space between lat and long.
(Reference: http://www.smick.net/notebook/how-to-link-to-a-gps-coordinate-on-a-webpage-using-geo-url)
<a href="geo:38.62464092991612,-90.18476128578186">go here</a>
Best read: HTML5 Geolocation and old browser support: http://diveintohtml5.info/geolocation.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment