I have <div>
with a <p>
tag containing a phone number. In CSS I have the property with color: #000
. However, only in Safari, it is not working. The phone is white.
It's like Safari was putting the color on its own.
I have <div>
with a <p>
tag containing a phone number. In CSS I have the property with color: #000
. However, only in Safari, it is not working. The phone is white.
It's like Safari was putting the color on its own.
This is most likely due to the fact that most mobile operating systems automatically identify phone numbers and create a link of them with the smartphone dialer to "facilitate" the user's life .
To remove this functionality in browsers / webviews, there are basically two solutions:
format-detection
: <meta name="format-detection" content="telephone=no">
This prevents phone numbers from being converted in the HTML page in question.
inline
: <!-- Poderia ser qualquer elemento inline -->
<span>9911-</span><span>2233</span>
Separating the phone into multiple elements makes the algorithm life that identifies numbers difficult, so they are not identified and consequently altered.
I used a solution presented here and another from another forum and solved the problem.
Safari does not recognize css because of the "dialer" function. Chrome recognizes css
If you use the metatag here proposed, the site would lose usability since clients would have to copy or memorize the number to call
Then I did the following:
I used the proposed meta tag here: <meta name format-detection" content="telephone=no">
(thanks, good tip)
And I put a HREF on the phone: <a href="#">#
I did the following form and it worked:
HTML
<span>(99) 9999-9999</span>
CSS
span {color:#000000;}
span a {color:#000000;}
Even though there is no <a>
in HTML I considered it as if it existed in css. It worked fine here.