A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).
:first-child
pseudo-classThe :first-child pseudo-class matches when the element E is the first child of the parent element.
E: first-child {...}
A link has five states in CSS which have the below corresponding pseudo-classes.
Pseudo-class | Description |
---|---|
:link | for links that have not yet been visited |
:visited | for links that have been visited |
:hover | for a link with the mouse pointer over it |
:active | for a link when it is activated (when the mouse pointer is clicked on it) |
:focus | for a link that has the focus (use |