Usage of :hover pseudo-class in CSS

The :hover pseudo class is used to add special style to an element when you mouse over it. Possible values could be any color name in any valid format.

Example

<html>
   <head>
      <style>
         a:hover {
            color: #FFCC00
         }
      </style>
   </head>
   <body>
      <a href = "">Bring Mouse Here</a>
   </body>
</html>
Updated on: 2020-03-04T12:45:06+05:30

117 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements