I do not normally use named anchors, so I have not encountered this problem, even though my style sheet would have made it possible if I did. Just to be safe and for future use, I am changing my style sheet per the following recommendation:
<a href="http://devedge.netscape.com/viewsource/2003/arbitrary-hover/">Issues Arising From Arbitrary-Element Hover</a>: “This brings up the second common problem, which is that named anchors can accept hover styles. Although authors may intend the selector <code>a:hover</code> to apply only to hyperlinks, it will also apply to named anchors, since the selector merely states that any a element which is in a hover state will be styled. In order to avoid this problem, authors should use the combined pseudo-class syntax described by CSS2:
a:link:hover {color: red;}
a:visited:hover {color: maroon;}
Note that, with this syntax, it is possible to styles visited and unvisited links differently when they are hovered. This was not possible with simple <code>a:hover</code>. It does mean, of course, that the selector <code>a:link:hover</code> will only apply to unvisited links, so authors who want the same hover style to apply to both visited and unvisited links should group the two selectors into a single rule.”
Like this:
Like Loading...
If you liked this post, here are some others you might enjoy…