Skip to main content

What is a pseudo-element?

A pseudo-element in CSS is a "virtual part" of an element that you can style, even though it does not exist in the HTML. It lets you style a fragment of content or add decorative details without adding extra markup. Examples: ::before, ::after, ::first-line, ::placeholder.

Short Answer

Interview ready
Premium

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