A “New” Way to Style Any Links 0 ▲ SteGrainer.com - Journal 1 hour ago · Tech · hide Today I learned about the CSS pseudo-selector :any-link. It can be used to match any anchor element with an href link, whether that link has been visited or not. In other words, it’s a useful shorthand instead of referencing both the :link and :visited pseudo selectors for combined styles. Apparently this pseudo-selector has been around and widely supported since January 2020, but I only just heard about it today. Maybe I’m not the only one.In the old days, I would define basic link styles like this, using the classic LoVeHAte mnemonic. a { base styles } a:link { unvisited styles } a:visited { visited styles } a:hover, a:focus { hover and focus styles } a:active { active styles } That option could occasionally spawn specificity problems unless I was forward-thinking in how I layered styles down the cascade. (Anything defined in the basic a styles would only stick if it weren’t overwritten by the later rules, which are more specific.) More recently, I’ve taken to combining some things… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town