CSS Reference

":link" - css pseudo-class (v. css 1)

  • Will add a style to an unvisited link .
  • HTML usage: all elements
  • Note: that the :hover must be placed after the :link and :visited rules, since otherwise the cascading rules will hide the 'color' property of the :hover rule.
  • Similarly, because :active is placed after :hover, the active color will apply when the user both activates and hovers over the element.
  • Browsers that support the :link - pseudo-class :
    Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari
Typical usage:
a:link    { color: red }    /* unvisited links */

Pseudo-class ":link" example:

<!DOCTYPE HTML >
<html>
  <head>
    <title>Page title</title>
    <style type="text/css">
      input[type='submit']:hover {
        background-color: #FF8000;
        color: #0080FF; }
     input[type='submit']:active {
        background-color: #0000FF;
        color: #FFFF00; }
      a:link {   background-color: #000000;
        color: #FFFFFF; }
      a:visited { background-color: #97FF31;
        color: #9831FF;  }
      a:hover { background-color: #7171E8;
        color: #E8E871; }
      a:active { background-color: #0000FF;
        color: #FFFF00; }
    </style>
  </head>
  <body>
    <form action="http://www.yahoo.com" target="_blank">
      Go to : <input type="submit" value="Yahoo" />
    </form>
    <a href="http://www.e-source4u.com" target="_blank">
      Go to www.e-source4u.com!</a>
  </body>
</html>
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.