Pseudo class:
- Pseudo class is used to
- define the special state of an element.
- to style an element when user mouse over it.
- to style visited and unvisited links differently.
- 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.