Pseudo class:

  • Pseudo class is used to
    1. define the special state of an element.
    2. to style an element when user mouse over it.
    3. to style visited and unvisited links differently.
    4. to style an element when it get focused.
  • pseudo class selector is identified by colon (:).
  • Syntax: selector: pseudo { property: value } (or)
  • selector.class:pseudo { property: value }
     Code:
     
      
 
     Output:
    
  • Here i changed the background color of button from blue to black when we place mouse on it.
  • And after placing mouse over Forget Password, it turns into red color  by using pseudo class.