I came across this issue when testing a stylesheet across different browsers, including IE6 (yes, I know..)
<head>
<style>
a:link, a:visited, a:hover, a:active { font-weight: bold; color: #000; text-decoration: underline }
.myclass a { color: red; text-decoration: none; }
</style>
</head>
<body>
<p>This is a <a href="1">test</a></p>
<div class="myclass">
<p>This is a <a href="2">test</a></p>
</div>
</body>
Results:
- In IE6, the
.myclass a
rule only applies to the unvisited link state - In other browsers (FF, Chrome), the
.myclass a
rule applies to all link states
I believe that IE6 is wrong and that .myclass a
, with no pseudo-classes specified, should apply to all link states. However I came across this SO question where it says that a
is equivalent to a:link
. This would match the behaviour in IE6. However I cannot find any official reference confirming this.
Which one is right?
Update:
As noted in the comments, the accepted answer to the question referenced above has since been updated.