CSS link visited underline style not working on Safari

In the macOS Desktop document using the html format, the link element 'a' can be styled as a wavy underline by using CSS statement a { text-decoration-style: wavy; } as shown at https://www.w3schools.com/css/css_text_decoration.asp. However (problem), for the Desktop html document in all macOS browsers, using a 'solid' underline for un-visited links and a 'wavy' underline for visited links is impossible.


This is because all local macOS browsers ignore the 'a:visited' pseudo-element text-decoration-style property. Please improve Apple by allowing style for unique display of the CSS pseudo-element a:visited { text-decoration-style: property; }. W3 allowed properties for text-decoration-style are solid, double, dotted, wavy, none. Thank you. 


[Re-Titled by Moderator]

Mac Pro, macOS 12.7

Posted on Oct 15, 2023 07:18 PM

Reply

Similar questions

12 replies

Oct 15, 2023 08:04 PM in response to Osiyo

COULD THERE BE A GLOBAL DEVELOPER CONUNDRUM, where the text decoration syntax for the link element 'a' is established, but the browser behavior (s) do not yet fit? The link pseudo element's a:visited text decoration display style simply does not exist yet but is pending and will appear later?


For example, this does not work on Desktop, proofing locally the local html documents. Nor does it work at W3Schools in the online demonstration. The link coding potential is obvious.


a { text-decoration-style: solid; }
a:visited { text-decoration-style: wavy; }

Oct 15, 2023 10:33 PM in response to Osiyo

DOES WORK ONLINE AT W3SCHOOLS ~ WHY NOT WORKING LOCAL ON MAC DESKTOP

To see this working in browser, visit w3Schools page CSS Text Decoration, scroll down to Specify a Style for the Decoration Line. Click on Try it Yourself. Adjust the demonstration code. Under the 'p.ex3' add 2 new link elements, 'p.ex3 a { text-decoration-style: wavy; } ' and 'p.ex3 a:visited { text-decoration-style: solid; }'. Then add a link to the demonstration line 'p class="ex3' as follows: 'p class="ex3" ~ a href = ""'.


Now, clink on the edited ex3 link in the preview.

Link visited a:visited changes text-decoration-style from wavy underline to solid underline when a link is followed. Why does this not work for local html files link local underline style on my Mac? Why only online link underline style, not local underline style?

Oct 16, 2023 05:08 AM in response to Osiyo

Osiyo wrote:

COULD THERE BE A GLOBAL DEVELOPER CONUNDRUM, where the text decoration syntax for the link element 'a' is established, but the browser behavior (s) do not yet fit?

It's been this way since the World Wide Web was first created. Every web browser has quirks. If you are committed to publishing a website the relies on something that doesn't have good cross-platform support, it is your responsibility to add the required hacks to your site.


This is the way it has always been.


This will never change.

Oct 16, 2023 05:53 AM in response to etresoft

etresoft wrote "hacks to your site"?


Apple's Safari web browser is not mine in any way. But if it helps, yes about 59 years. Early browsers used color to display visited links. Today the visited links specification includes very common styling for element 'a' and very common styling for pseudo element 'a:visited'. Color remains very popular, though text decoration is often found in publishing, library, education and large corporations. C'est moi.


I am publishing a large legal document with many links. So a:visited and specifically text-decoration-style is very important. And must suit specific cultural perspectives. Can we hack that?

Oct 16, 2023 06:25 AM in response to Osiyo

etresoft wrote "hacks to your site"?


Apple's Safari web browser is not mine in any way. But if it helps, yes about 59 years. Early browsers used color to display visited links. Today the visited links specification includes very common styling for element 'a' and very common styling for pseudo element 'a:visited'. Color remains very popular, though text decoration is often found in publishing, library, education and large corporations. C'est moi.


I am publishing a large legal document with many links. So a:visited and specifically text-decoration-style are very important! And must suit specific cultural perspectives, norms even. We can 'hack' that?


It is a bummer perhaps, that writing on an Apple mac one has no desktop author software preview of what the heck the online visited links look like, without guessing or wasting time and space running additional software, connections and security. Did I miss something?


By the way, the 'blink" specification was removed, leaving just 3 visible options! Surely 3 popular styles are not too much for Apple?

Oct 16, 2023 06:43 AM in response to Osiyo

Osiyo wrote:

I am publishing a large legal document with many links. So a:visited and specifically text-decoration-style is very important. And must suit specific cultural perspectives. Can we hack that?


Use PDF for more complete control of rendering.


Otherwise, you’re going to have to tussle with every web browser, and with how that particular browser renders your content over different versions, and with how the particular user has configured the browser, and with privacy. Since its inception, designers have been trying to exert control over page rendering, and getting frustrated with that effort as HTML and web browsers generally gave that control (and gave it differently) to different browsers and to browser users.


Per the Safari footnotes in the CSS referendes, wavy requires Safari 12.1 (Released 2019-03-25):

https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-style


As Urquhart1244 mentions, the visited rendering is further limited: “For privacy reasons, browsers strictly limit which styles you can apply using this pseudo-class, and how they can be used:” “Allowable CSS properties are colorbackground-colorborder-colorborder-bottom-colorborder-left-colorborder-right-colorborder-top-colorcolumn-rule-coloroutline-colortext-decoration-color, and text-emphasis-color.” Wavy isn’t included there.


Based on that last bit of documentation and on Apple’s general privacy proclivities, and on your page-rendering preferences, you’re seemingly headed for PDF here, and not toward CSS here. Privacy? Yes, I know of web sites that do take different actions based on the visited state of site-unrelated links. There was a recent kerfuffle about exactly that among some netizens, too.

Oct 16, 2023 08:44 AM in response to Osiyo

Osiyo wrote:

etresoft wrote "hacks to your site"?

Apple's Safari web browser is not mine in any way.

That's why I said "your site" and not "the web browser you are using".

Today the visited links specification includes very common styling for element 'a' and very common styling for pseudo element 'a:visited'. Color remains very popular, though text decoration is often found in publishing, library, education and large corporations.

I am publishing a large legal document with many links. So a:visited and specifically text-decoration-style are very important! And must suit specific cultural perspectives, norms even. We can 'hack' that?

Anything can be hacked. Hence the word.

It is a bummer perhaps, that writing on an Apple mac one has no desktop author software preview of what the heck the online visited links look like, without guessing or wasting time and space running additional software, connections and security. Did I miss something?

See Urquhart1244's post above. Personally, I think that is a silly restriction since colour is still allowed. But maybe the window.getComputedStyle hacks that. But hacks are hacks. There's always a way to do it. I'm sure these restrictions are targeted towards malicious activity like malware injection. If this is your site, you should be able to hack it up to display the links however you want. You might need to get creative about it, however. And the effort may be more than is really worth.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

CSS link visited underline style not working on Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.