How to disable phone number linking in Mobile Safari?

前端 未结 24 1721
面向向阳花
面向向阳花 2020-11-22 16:56

Safari on iPhone automatically creates links for strings of digits that appear to the telephone numbers. I am writing a web page containing an IP address, and Safari is tur

24条回答
  •  一生所求
    2020-11-22 17:35

    does not work for emails: if the HTML you are preparing is for an email, the metatag will be ignored.

    If what you are targeting are emails, here's yet another ugly-but-works solution for ya'll:

    Example of some HTML you want to avoid being linked or auto formatted:

    will cease operations on June 1,
    2012.
    

    And the CSS that will make the magic happen:

    @media only screen and (device-width: 768px) and (orientation:portrait){
    span.ios-date{display:none;}
    span.ios-date + span:after{content:"on June 1, 2012";}
    }
    

    The drawback: you may need a media query for each of the ipad/iphone portrait/landscape combos

提交回复
热议问题