/* unvisited link */
a:link {
  color: yellow;
}

/* visited link */
a:visited {
  color: yellow;
}

/* mouse over link */
a:hover {
  color: gray;
}

/* selected link */
a:active {
  color: yellow;
}




Styling a link depending on state

This is a link
Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.
Note: a:active MUST come after a:hover in the CSS definition in order to be effective.