mailto: 和 tel: 移动网络上锚标记中包含图像的方案
我将锚标记绝对定位在页面的右下角(一个水平相邻)。其中一个锚点是 mailto: 链接,另一个是 tel: 链接。每个都包含图像而不是文本。两者似乎都无法在我的 Android 设备上正常工作。我可以选择每个链接,但只有当我长按时,我才能选择拨打该号码或发送电子邮件。如果我删除图像并使用电话号码和电子邮件的实际文本,则会发生适当的操作。在让手机识别非实际文本的电话号码和电子邮件时,是否存在一些我不知道的细微差别?
<a class="emailTag" href="mailto:[email protected]">
<img src="email_img.png" alt="[email protected]" />
</a>
<a class="phoneTag" href="tel:1234567890">
<img src="phone_img.png" alt="1234567890" />
</a>
我还尝试删除 img 标签并为锚标签设置背景图像,但我得到了相同的结果。
I have anchor tags positioned absolutely (one next to the other horizontally) at the bottom right corner of the page. One of the anchors is a mailto: link and the other is a tel: link. Each contains an image instead of text. Neither seem to work appropriately on my Android device. I can select each link, but only when I long-press do I get the option to call the number or send an email. If I get rid of the images and use the actual text for the phone number and email, the appropriate action happens. Is there some nuances I'm not aware of when it comes to making phones acknowledge phone numbers and emails that aren't actual text?
<a class="emailTag" href="mailto:[email protected]">
<img src="email_img.png" alt="[email protected]" />
</a>
<a class="phoneTag" href="tel:1234567890">
<img src="phone_img.png" alt="1234567890" />
</a>
I've also tried removing the img tag and setting the background-image for the anchor tags instead, but I get the same result.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的 2.2 设备上没有遇到您的问题。
您是否尝试过进行简单的测试以避免其他 css/js 的任何副作用?
Google 在其移动搜索结果中这样做:
0123456789
它可能适合您。
I don't have your problem on my 2.2 device.
Have you tried to make a simple test to avoid any side effects from your other css/js ?
Google in its mobile search results is doing this:
<div onclick="window.location.href = 'tel:0123456789'" >0123456789</div>
It might work for you.