CSS Link Properties

The values for link property can be:

a:link -  It defines the style for unvisited links.
a:visited - It defines the style for visited links.
a:active - It defines the style for active links.
a:hover - A link is hovered when the mouse moves over it.

Example: Demonstration of link property

<!DOCTYPE html>
<html>
     <head>
          <style>
          /* visited link */
          a:visited
          {
               color: orange;
          }
          /* mouse over link */
          a:hover
          {
               color: hotpink;
          }
          /* selected link */
          a:active
          {
               color: blue;
          }
          </style>
     </head>
     <body>
          <p><b><a href="color.html">This is a link</a></b></p>
          <p><b>Note:</b> a:hover MUST come after a:link and a:visited in the CSS definition. The order is effective here.</p>
          <p><b>Note:</b> a:active MUST come after a:hover in the CSS definition. The order is effective here.</p>
     </body>
</html>


Output:
This is a link
Note: a:hover MUST come after a:link and a:visited in the CSS definition. The order is effective here.
Note: a:active MUST come after a:hover in the CSS definition. The order is effective here.