It appears that at one point in time combining multiple pseudo-selectors was possible. For example, one could do this:
a:visited:hover {color: red}
A quick Google search reveals multiple examples of this in action, here, here, and here. I am unable to get this feature to work in the latest versions of Safari, Firefox, or Chrome. Can anyone explain why this feature has regressed and/or been handicapped?
The :visited
pseudoclass can't be used for most styling in a lot of modern browsers anymore because it's a security hole. See this link for a more formal discussion on it.
The short version is that if you can style :visited
links differently, you can use that to determine if people have visited various sites, and therefore target them based on their browser history. Most modern browsers therefore heavily restrict the styling that can be done on them.
You can still chain pseudoselectors. For example, a:focus:hover
works just fine to apply styles only if the element is focused AND hovered. See this link for a demonstration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With