La proprietà content genera contenuto tramite CSS (con ::before e ::after).
Testo e simboli
.required::after {
content: " *";
color: red;
}
.external-link::after {
content: " ↗";
}Attributi HTML
a[href]::after {
content: " (" attr(href) ")";
}
/* Mostra data-tooltip */
[data-tooltip]:hover::after {
content: attr(data-tooltip);
}Contatori
ol {
counter-reset: section;
}
li::before {
counter-increment: section;
content: counter(section) ". ";
}Immagini
.icon::before {
content: url("icon.svg");
}