Skip to main content

What is a pseudo-class in CSS?

A pseudo-class in CSS is a selector that describes a special state of an element, not the element itself. For example, :hover, :focus, or :active apply styles not always, but only when the element is in a certain state (the cursor is over it, it is focused, and so on).

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.