Skip to main content

What does ::before do?

::before creates a pseudo-element before the content of the selected element. It is used for decorative details (icons, lines, shapes) or extra text. To display, it requires the content property.

Short Answer

Interview ready
Premium

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