Set different color for link in its four states - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Color

Description

Set different color for link in its four states

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">

/* unvisited link */
a:link {
   color: #FF0000;
}
/* visited link */
a:visited {<!--from w w w  .ja  v a  2s  .  c  om-->
   color: #00FF00;
}
/* mouse over link */
a:hover {
   color: red;
}
/* selected link */
a:active {
   color: #0000FF;
}


      </style> 
 </head> 
 <body> 
  <p> <b> <a href="#" target="_blank">This is a link</a> </b> </p>  
 </body>
</html>

Related Tutorials