iPad Contact Link CSS Override

2020-06-17 03:58发布

I have a web page with a phone number being displayed in the page header. The font color for that section of the page is brown.

When the page is viewed on an iPad, the iPad (correctly) detects the text as a phone number and automagically converts the phone number text to a "contact link".

My problem is that I am unable to FORCE the link color to be brown - regardless of what I do in the CSS file (including "! important" after the color statement), the phone number is always being displayed in it's own self-appointed color!

Any clues on how to get my CSS declaration to win the war?

标签: css ipad
5条回答
疯言疯语
2楼-- · 2020-06-17 04:37

Try this, it worked for me (change the color code):

a.phone[href^=tel]:link { color:#9F6; }
查看更多
仙女界的扛把子
3楼-- · 2020-06-17 04:38

It seems like ipad wraps the number in an <a>. I just added an additional rule for this:

Before: .phone { color:red; }

After: .phone, .phone a { color:red; }

查看更多
放我归山
4楼-- · 2020-06-17 04:39
    <meta name = "format-detection" content = "telephone=no">

Works for me. Check this for more detail.

http://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html

查看更多
Ridiculous、
5楼-- · 2020-06-17 04:41
(360) 687<i>-</i>8936 

I have a client who is a crazy person. He wants his phone number all over the website, and in only one place does it clash with the iphone/ipad auto-linking parser.

So, adding the i tag around the dash fooled iOS into seeing it not as a phone

查看更多
可以哭但决不认输i
6楼-- · 2020-06-17 04:43

Have a look on this page (format-detection) ;)

查看更多
登录 后发表回答