pseudo-classes Flashcards
1
Q
What is a pseudo-class?
A
a keyword added to a selector that specifies a special state of the selected element(s).
eg.
:hover
can be used to select a button when a user’s pointer hovers over the button. This selected button can then be styled.
2
Q
What are CSS pseudo-classes useful for?
A
Pseudo-classes 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
eg. :visited
the status of its content
eg. :checked
on certain form elements,
or the position of the mouse
eg. :hover
which lets you know if
the mouse is over an element or not).