How do I make a link on a website that has two possible outcomes depending on which type of device you are using (mobile app vs. native).
Mobile
<a href="fb://profile/6815841748">Facebook</a>
<a href="instagram://user?username=barackobama">Instagram</a>
<a href="twitter://813286">Twitter</a>
If clicked on desktop, I get: "There is no application set to open the URL"
Native
<a href="https://www.facebook.com/6815841748">Facebook</a>
<a href="https://www.instagram.com/barackobama">Instagram</a>
<a href="https://www.twitter.com/813286">Twitter</a>
This redirects to social media site in browser; not in app for mobile.
I'm not sure if this is something I can do with pure HTML5 or use jQuery/Javascript?
I also don't know if I need to write mobile-app URLs specific to each OS (iOS/Android/Windows,etc). I only have iOS to test on.
Note: I'd prefer not to use CSS width, because I feel it is not best practice. This easily breaks if a desktop user clicks the link using split screen or a resized window.