• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 62. Changing the Color of a Sing... > Changing the Default Color for Indiv...

Changing the Default Color for Individual Link States

If your special link color needs to change depending on the state of the link, the style attribute of the anchor tag doesn't really help you out, since you need access to the pseudo-classes of the anchor tag. Not a problem—just create a special class style, like this:

<style type="text/css">

  a.special:link {
    color: #FF0000;
  }

  a.special:visited {
    color: #CC0000;
  }

  a.special:active {
    color: #990000;
  }

  a.special:hover {
    color: #660000;
  }

</style>

<body>

  <a class="special" href="../special1.htm">See Our Specials</a>
  <a class="special" href="../special2.htm">See More Specials</a>

</body>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint