Computer >> Computer tutorials >  >> Programming >> CSS

How to change the color of active links with CSS


Use the :active class to change the color of active links. Possible values could be any color name in any valid format. 

Example

You can try to run the following code to implement the color of an active link −

<html>
   <head>
      <style>
         a:active {
            color: #FF00CC
         }
      </style>
   </head>
   <body>
      <a href = "">My Link</a>
   </body>
</html>