Dynamic pseudo-classes classify elements on characteristics other than their name, attributes, or content, in principle characteristics that cannot be deduced from the document tree.
Usage A CSS pseudo-class is a keyword added to selectors that specifies a special state of the element to be selected. For example :hover will apply a style when the user hovers over the element specified by the selector.
Pseudo-classes, together with pseudo-elements, let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the navigator (:visited
, for example), the status of its content (like :checked
on some form elements), or the position of the mouse (like :hover
which lets you know if the mouse is over an element or not).
a:link
a:visited
a:hover
a:active
An example of combining dynamic pseudo-classes:
a:focus
a:focus:hover
The last selector matches a
elements that are in the pseudo-class :focus
and in the pseudo-class :hover
.
AttributionsNote: An element can be both ‘
:visited
’ and ‘:active
’ (or ‘:link
’ and ‘:active
’).
Mozilla Developer Network : Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4