What is the differences between a {...}
and a:link{...}
?
Are there different usages, and benefits between them?
According to W3C a:link
is for not visited, a:visited
is for visited, and just a
applies to both.
a:link
is for anchor tags that are links (have an href
) attribute. a
affects all anchor tags. (See, e.g., jsbin.com/uxuyum/1)
Commented
Jul 2, 2013 at 12:44
a
covers all the bases. a:link
is used only if the link in un-visited
, un-hover
ed, and in-active
.
So, use a
for things like font-family (if you want links to come up in a different font), then use link
for the standard formatting, and visited
, hover
and active
for 'special effects'.
EDIT: After reading Sander's W3C link, I can see that I didn't have it quite right. a:link
will cascade down to a:hover
and a:active
, i.e. anything in a:link
that is not over-ridden by the dynamic pseudo-classes will also apply to them.
a:link
only affects links that have a href attribute basically (if a:visited, a:hover or a:active does not apply)... The main case where I've noticed a difference is that a:link
doesn't affect Named Anchors whereas a
will. Also, a
is the default style if none of the other pseudo classes are defiend.
<a name="Section1">Section 1</a>
a
to change the style. It's not true thought that everything with an href is affected by a:link
Commented
Dec 17, 2009 at 15:59
a
tag.a:link
is a pseudo class whilea
is base HTML anchor tag.