A pseudo-class is used to define a special state of an element, such as when a user mouses over it, or when a link has been visited.
| Pseudo-class | Selects |
|---|---|
| :hover | Mouse over element |
| :active | Clicked element |
| :focus | Focused element |
| :first-child | First child element |
| :last-child | Last child element |
| :nth-child(n) | nth child element |
| :not(selector) | Not matching selector |
| :checked | Checked input |
Edit the code below and click Run to see the result live.