style links: link, visited, hover, focus, active : a.class « CSS « HTML / CSS

HTML / CSS » CSS » a.class 
style links: link, visited, hover, focus, active
  

<?xml version"1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <style type="text/css">
      a:link 
          color: red; 
          text-decoration: none 
      }
      a:visited 
          color: green; 
          text-decoration: none;
      }
      a:hover {
          color: blue; 
          text-decoration: underlined;
      }
      a:active {
          color: black; 
          text-decoration: none;
      }
      a:focus {
          color: yellow; 
          text-decoration: underlined;
      }
    </style>
    <title>Using CSS with Anchors</title>
  </head>
  <body>
    <p>
      <a href="mailto:w@m.com">Send Feedback</a>
    </p>
  </body>
</html>

   
  
Related examples in the same category
1.Use a:link to select a hyperlink when it has not been visited.
2.Use a:visited to select a hyperlink when it has been visited
3.Use a:hover to select a hyperlink when the mouse hovers over it.
4.Use a:focus to select a hyperlink when it receives focus in other browsers.
5.Use a:active to select a hyperlink when it receives focus in IE.
6.Link types
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.