Change the Color of Link when a Mouse Hovers


To change the color of a link when we bring a mouse pointer over that link, use the: hover property.

Example

You can try to run the following code to change the link color:

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

Updated on: 31-Jan-2020

718 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements