Name

::before

Erzeugt:

Ein Pseudoelement für erzeugten Inhalt, der vor dem eigentlichen Inhalt eines Elements platziert wird

Beschreibung:

Erlaubt es, erzeugten Inhalt am Anfang des Inhalts eines Elements einzufügen. Standardmäßig ist das Pseudoelement ein Inline-Element, aber dies kann mit Hilfe der Eigenschaft display geändert werden.

Beispiele:

a[href]:before {content: "[LINK] ";)
p:before {content: attr(class);}
a[rel|="met"]:before {content: " *";}

Get CSS kurz & gut, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.