I am trying to select all links except those that are internal and mail links and anchor links (#) So I want to combine selectors so that they exclude X, Y and Z. However, I cannot figure out how to join them.
a:not([href*="myurl"]) { }
This CSS finds all links that do not contain myurl, however it also finds mailto: and anchor (#) links, and I would like to exclude this from the selector.
I need to use a non selector to find all the URLs outside of my site, since I donโt know how to say โall sites are outside my siteโ without using no. Is there any way to do this like
a:not([href*="myurl OR # OR mailto"]) { }
The full code uses: hover and: after, if that matters:
a:not([href*="myurl"]):hover:after { }
This needs to be done entirely in CSS, not jquery / javascript. And I can not add classes to the URL.
Is it possible? (A cross browser is not that important. Chrome + Firefox will be good enough)
My current job is to target other links with not([href*="http:// "]) { } , but this is not preferable because it means rewriting the changes again, which does not always work, because that it could be color: red , and another color: blue and I canโt make them return to the original colors (among other reasons)
source share