Phone numbers - Post ID 209283

User 1964159 Photo


Registered User
156 posts

Hi all,
Just a quickie, I suspect. I've been looking around for the necessary coding for a specific thing:
Responsive Design > mobile version - it would be nice to have a contact number as a link, which when activated will dial out the number from the device in use. I suspect is it coded something like a link (a href =tel: "12345 543210" /> OR SOMETHING LIKE THAT! What to do about the international dialing protocol? From outside the UK, people would dial +44 (0)1234 543210 - leaving out the first zero. Dialing from UK would simply be 01234 543210 - if you see what I mean.
Any advice appreciated< I have been all over the W£C looking for it.
Tony
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

<a href="tel:3174562564">Call me</a>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 1964159 Photo


Registered User
156 posts

User 1964159 Photo


Registered User
156 posts

I only mashed up the code slightly and once Eric replied - piece of cake, as they say.
Until I tried to put in the CSS!
I want to phone number to display in full on large medium screens
But only the link to that number on small screens, so it can be dialled off the bat:

HTML snip
<p class="phone">Tel: +44 (0)7876 574201</p>
<a class="dial"href="tel:07876574201">Call Me from your cellphone</a>

CSS small screens:
.phone { display: none; } The full number disappears, leaving the dial-up link. GREAT!

But as soon as I add:
.dial { display: none; } to large and med screen CSS it all disappears from small screen, link and all.
That's seriously WIERD! OK not the end of the world, but it would be nicer to get it right.
Tony
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

Try @media queries.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 1964159 Photo


Registered User
156 posts

Sorry Eric, slow getting back to you. Media queries worked - even got a little sprite of a mobile phone along-side the link
Many thanks Sir.
Tony

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.