Saturday, 24 August 2013

Why do we need "a:link"? Why not just "a"?

Why do we need "a:link"? Why not just "a"?

It seems the following variants produce identical results:
/* 1 */
a, a:visited, a:active { color: black; }
a:hover { color: red; }
/* 2 */
a, a:link, a:visited, a:active { color: black; }
a:hover { color: red; }
/* 3 */
a:link, a:visited, a:active { color: black; }
a:hover { color: red; }
Most guidance on the web uses 2 or 3. Why not go for the simplest variant
which is 1? I cannot find a good reason to ever apply :link if all you
need is one style for normal links and one for hover.
Is it best-practice to not use :link? Why or why not?

No comments:

Post a Comment