如何在桌面上禁用电话号码链接? [英] How to disable link to phone number when on Desktop?

查看:36
本文介绍了如何在桌面上禁用电话号码链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将电话号码添加到可点击但在我浏览不支持触摸的网站时隐藏链接的网站.

How can I add a phone number to a website that is clickable but hides the link when I'm browsing on a website that doesn't support touch.

不过我可以使用 Modernizr 来设置它.我不知道怎么办.

I could use Modernizr to set it up although. I don't know how.

<a href="tel:1300723579"><p><img src="assets/images/bt_calltoaction.gif" alt="View Projects" width="306" height="60"></p></a>

推荐答案

我只是在处理这个问题,寻找解决方案,然后我发现了这个线程(以及其他一些线程).我不得不承认我无法让它们中的任何一个正常工作.我确定我做错了什么,但我确实发现了作弊.

I was just dealing with this issue, looking up solutions, and I found this thread (and a few others). I have to confess that I couldn't get any of them to work properly. I'm sure I was doing something wrong, BUT I did figure out a cheat.

正如其他人指出的那样,更改 CSS 以隐藏可见链接指示(colortext-decorationcursor)是第一步也是最简单的一步.秘籍是为 tel 链接定义一个 title.

As others have pointed out, changing the CSS to hide the visible link indication (color, text-decoration, cursor) is the first and easiest step. The cheat is to define a title for the tel link.

<p>Just call us at <a class="cssclassname" href="tel:18005555555" 
title="CLICK TO DIAL - Mobile Only">(800) 555-5555</a>.</p>

通过这样做,不仅链接的可见指示符被伪装了(通过 CSS - 参见其他人的例子),而且如果有人将鼠标悬停在链接上,标题会弹出并说点击拨号 - 仅限移动设备".这样,不仅有更好的用户体验,而且您的客户也不会指责您的链接已损坏!

By doing this, not only is the visible indicator of a link disguised (via CSS - see examples from others), but if someone does hover over the link, the title will pop up and say "CLICK TO DIAL - Mobile Only". That way, not only is there a better user experience, but your client doesn't accuse you of having a broken link!

这篇关于如何在桌面上禁用电话号码链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆