CSS: Pseudo Element

By Xah Lee. Date: . Last updated: .

What is Pseudo-Element

“Pseudo-element” means part of an element, such as first letter, first line.

List of Pseudo-Element Selectors

pseudo element syntax change, one colon to two colons

in CSS 2, pseudo-element syntax is with 1 single colon. e.g. :first-letter

in CSS 3 (2011), it's changed to 2 colons, e.g. ::first-letter.

This change is made so that there is distinction between 2 concepts:

Single colon is still supported in browsers, for backward compatibility.

As of 2018, most websites still use 1 single colon.

CSS, pseudo-element and pseudo-class

CSS, misc, advanced