The :link pseudo- :link applies to a link, even if you hover over it. Since the style with the identifier is more specific, it overrides the rest.
The only reason the style :hover overrides the style :link is because it comes later in the stylesheet. If you place them in the following order:
a:hover { color: red; } a:link { color: blue; }
style :link is later in the stylesheet and redefines style :hover . The link remains blue when you hover over it.
To make a :hover style style for a black link, you must make it at least as specific as the :link style, and put it after it in the stylesheet:
a:link { color: blue; } a:hover { color: red; } #someID a:link { color: black; } #someID a:hover { color: red; }
source share