Pseudo-class
A CSS pseudo-class selects an element based on state, position or another condition that is not expressed as a normal element attribute.
Examples include :hover, :focus, :checked, :first-child and :not(). Pseudo-classes can be combined with ordinary selectors.
Selecting an element by state
Examples include :hover, :focus, :checked, :first-child and :not(). Pseudo-classes can be combined with ordinary selectors. In practical terms, Pseudo-class belongs to the presentation and layout layer. Knowing that layer is important because it tells you what the term can change, what it cannot change, and where to look when something behaves unexpectedly.
Styling hover, focus or structural position
button:hover and input:focus-visible style an element when it enters a particular state.
Where state-aware selectors help
You do not need to memorize the term in isolation. It becomes useful when you can recognize it in the tool, browser, file or conversation where the concept is doing real work.
Pseudo-classes and pseudo-elements do different jobs
A CSS pseudo-class selects an element based on state, position or another condition that is not expressed as a normal element attribute. By contrast, A CSS pseudo-element represents a generated or abstracted part of an element that can be styled without adding a separate HTML element. The two can appear in the same project, but they describe different parts of the work and should not be used as interchangeable labels.
The mistake: styling hover without keyboard focus
The common mistake is to use Pseudo-class as if it also meant Pseudo-element. That blurs two separate decisions and usually sends troubleshooting in the wrong direction. A better test is practical: Remember that hover is not a universal interaction on touch devices; provide keyboard-visible states too.
Why state belongs in the selector
In day-to-day work, Pseudo-class matters when the concept needs to be identified precisely instead of being grouped with a nearby term. The practical value is not the vocabulary itself; it is being able to identify the right control, file, setting or decision when the concept becomes relevant.
button:hover and input:focus-visible style an element when it enters a particular state. That example is useful because it turns the definition into something you can recognize, test and discuss with other people working on the same project.
Related terms worth learning next
Sources and further reading
Use these references when you need documentation-level detail, specifications or product-specific behavior beyond the plain-English explanation above.