modify tel attribute with css media query

Hi - we have the following in a responsive email:
<a href="tel:1-xxx-xxx-xxxx">1-xxx-xxx-xxxx</a>
Works great, but folks getting the email through their desktop outlook client get an "Access Denied" popup. Is there a way to have the tel protocol only display using media queries?
Thanks!
LVL 31
seanpowellAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
For an email, I think you are best to keep as normal text.  Phones typically can distinguish the  format of your number and create the link automatically.
0
HagayMandelCommented:
Use a conditioned script to assign different attributes on different media.
Try:

jQuery(".CLASSNAME").attr("href","CONCRETE_ATTRIBUTE_BASED_ON_MEDIA_T5YPE");
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I was not sure if media queries were fully supported but from one tester it looks supported enough http://www.emailonacid.com/blog/details/C13/media_queries_in_html_emails and even mailchimp shows it is a go http://templates.mailchimp.com/development/media-queries/ as long as you mark those styles as !important since most of your css should be inline.

With that in mind what you can do is have two versions of the phone and hide just one as needed.

<style type="text/css">

      .phoneMobile{display:none!important;}
      .phoneDesk{display:inline!important;}

    @media only screen and (max-width:480px){
        .phoneDesk{display:none!important;}
        .phoneMobile{display:inline!important;}
    }
</style>
<span class="phoneMobile"><a href="tel:1-xxx-xxx-xxxx">1-xxx-xxx-xxxx</a></span><span class="phoneDesk">1-xxx-xxx-xxxx</span>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
seanpowellAuthor Commented:
Thanks padas - much appreciated!
0
seanpowellAuthor Commented:
@ HagayMandel - sorry, can't use scripting in an email and as such required a css solution. Thanks for taking the time!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.