Pseudo-element

noun

say it: “SOO-doh EL-uh-ment” /ˈsuːdoʊ ˈɛləmənt/

A part of an element you can style, or a decoration you add to it, written with a double colon, such as ::before or ::marker, without changing the HTML.

What is a pseudo-element?

A pseudo-element styles a part of an element, or adds something that isn't in the HTML, like a first line or decoration before it. It starts with two colons.

p::first-line { font-weight: bold; }
.required::after { content: " *"; color: red; }

In a sentence

  • “A pseudo-element puts the little play arrow in front of the song that's playing; there's no arrow in the HTML at all.”

Level: Apprentice · More CSS terms at this level

Updated