Quantcast
Viewing latest article 4
Browse Latest Browse All 6

Answer by Everett Green for Why do we need "a:link"? Why not just "a"?

It is used to differentiate between simple anchors and anchors with href attributes. See demo jsfiddle here.

<style>a { color: red; }a:link { color: blue; }</style><a name="anchor">No href</a><br /><a href="http://stackoverflow.com/">With href</a>

EDIT:For this reason, it is important to cover all cases in your CSS. Option 2 is the only option that completely covers all cases. If you do not have anchor elements without href attributes, you are safe with option 1.


Viewing latest article 4
Browse Latest Browse All 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>