pseudo-element

::before — CSS reference

Creates a generated pseudo-element at the beginning of the originating element’s content when content generates a box. It is not an inserted DOM child; normal or none suppresses generation here. Replaced elements generally do not provide these generated children. Keep essential text in HTML, not CSS.

Formal Syntax & Structure

css syntaxcss
element::before { content: "text"; }

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a::before { content: "Start"; color: #006050; }</style><body><p id="a">Article</p><p id="b">Plain</p></body></html>
CSS Reference