Remove Microsoft Edge's phone number styling
To disable Microsoft Edge's phone number styling, simply add a meta tag and set its format-detection
attribute to no
.
Place this in the <head>
section of your HTML:
To specifically target Microsoft Edge, use x-ms-format-detection
:
This line of code tells Microsoft Edge to stop its sneaky phone number styling spree.
How to style your numbers and maintain UX
Custom CSS styling
To rid your web page of Microsoft Edge's default phone number stylings, use custom CSS like so:
Maintain click to call functionality
For those attached to the click to call functionality, you can maintain it with this CSS rule:
Sneaky HTML trick
A clever HTML trick can also solve your problem. By using zero-width spaces, you can keep Edge from recognizing numbers as phone links:
Problems you might run into and how to solve them
Potential problems with JavaScript
Using JavaScript to dynamically modify rendered content can become necessary when tackling complex scenarios. This approach, however, can have an impact on page load times, thus affecting user experience.
Being mindful of user experience
Fully disabling the automatic phone styling can prevent the users from initiating calls directly from your site. Always balance the design choices with the needs of your users.
Watch out for copied code
In your quest to rid your site of default stylings, you might be tempted to copy and paste code snippets from an array of sources. Beware though, as this can lead to unexpected behavior.
Was this article helpful?