Is there a way of specifying a:link, a:visited, a:hover, a:active
and maybe also a:focus
in one go using css?
If you want to style all anchors; not just anchors used as links, but named anchors as well (i.e. <a name="foo"></a>
) simply use the following css selector:
a
That's it.
If you don't want named anchors, but instead want to style only links that have an [href]
attribute, you should use the comma-separated list of selectors:
a:link,
a:visited,
a:hover,
a:focus,
a:active {
color: blue;
}
If you're running into specificity issues, you'll need to post some HTML code and review CSS specificity.
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