For me CSS as applied to markup is broken into two things… Everything that’s the same, and everything that is different.
Stating JUST “a” alone is as bad as stating a:pseudo for each and every state… one hits all anchors, the other only hits specific states, when in most cases you want BOTH behaviors.
“a” alone is great for hitting all the LIKE values for all the states so you don’t restate them over and over again for no reason. Font-size, font-family, text-decoration, paddings… Hit those with “a” alone.
The pseudo-states should then be used for when things are DIFFERENT – a different color to indicate it’s visited, different background for active, focus and hover… etc, etc…
Really I see no reason for a:link to ever be used – Hit A so you can nab all the states, then use the other psuedo’s to say the values that are DIFFERENT.
Anything more than that is probably just bloated code. I mean I’ve lost count of how many times I’ve seen bloated rubbish like:
a:link {
display:inline-block;
padding:8px 16px;
text-decoration:none;
font-weight:bold;
font-family:arial,helvetica,sans-serif;
font-size:14px;
line-height:16px;
color:#000;
}
a:visited {
display:inline-block;
padding:8px 16px;
text-decoration:none;
font-weight:bold;
font-family:arial,helvetica,sans-serif;
font-size:14px;
line-height:16px;
color:#800;
}
a:active {
display:inline-block;
padding:8px 16px;
text-decoration:none;
font-weight:bold;
font-family:arial,helvetica,sans-serif;
font-size:14px;
line-height:16px;
color:#F00;
}
a:focus {
display:inline-block;
padding:8px 16px;
text-decoration:none;
font-weight:bold;
font-family:arial,helvetica,sans-serif;
font-size:14px;
line-height:16px;
color:#F00;
}
a:hover {
display:inline-block;
padding:8px 16px;
text-decoration:none;
font-weight:bold;
font-family:arial,helvetica,sans-serif;
font-size:14px;
line-height:16px;
color:#F00;
}
Doing the job of:
a {
display:inline-block;
padding:8px 16px;
text-decoration:none;
font:bold 14px/16px arial,helvetica,sans-serif;
color:#000;
}
a:visited {
color:#800;
}
a:active,
a:focus,
a:hover {
color:#F00;
}