I've encountered a styling issue on my website when viewing it on mobile, specifically with links on iPhone. I've already attempted the solutions mentioned in this discussion: How do I remove the blue styling of telephone numbers on iPhone/iOS?
https://i.sstatic.net/fH1It.jpg
I've tested the following CSS:
a[href^="tel"],
span[href^="tel"] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
As well as this CSS:
a[x-apple-data-detectors],
span[x-apple-data-detectors] {
color: inherit !important;
text-decoration: none !important;
font-size: inherit !important;
font-family: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
}
Unfortunately, none of the above solutions have worked for me. I'm open to any suggestions on how I could resolve this issue using solely CSS so that the styling is consistent across all my web pages.
Update with a solution
The recommended approach is to avoid altering the default behavior of all <span>
or <a>
elements. Instead, consider applying styles using id or class on individual elements. A possible solution could be:
.lnd-header-button__text{
all: initial;
}
.lnd-header-button__text * {
all: unset;
}