I have the following in my CSS to display the URLs of
some links when the web document is printed:
@media print { a.showURL:after
{ content:" [URL " attr(href) "]"; }
}
That works fine, except that if a long URL happens to
occur midway on a line, it gets moved to the next line,
leaving a short line.
What I'd like to do is insert a zero-width space
​ after every slash except the initial https://.
I haven't been able to find a CSS way to do that, but I
thought it was worth asking in case I missed something.
Or is there some other way to accomplish this? I
suppose I could use attr(title) instead of attr(href)
and put the URL-with-ZWSPs in the title attribute, but
that seems pretty clunky and will look ugly if a person
reading on screen happens to hover over the link.
--
Stan Brown, Tehachapi, California, USA
https://BrownMath.com/