Well this isn't really a trick… It's just that I've had to search for this more times than I can count because I couldn't remember the exact way to write it – so I'm posting it here for my future reference.
.stylename a:link {
text-decoration: none;
color: #FF0000; //red
}
.stylename a:visited {
text-decoration: line-through;
color: #00FF00; //green
}
.stylename a:hover {
text-decoration: underline;
color: #0000FF;
background-color: #FFFF66; //blue
}
.stylename a:active {
text-decoration: overline;
color: #FFFF00; //yellow
}
[swiped from here]
(updated: fixed typo – and added a different color and "text-decoration" for each state so you can see which one is which when testing it)