CSS 3 · Selectors and the box model

Add generated content

Insert content before an element with no extra HTML.

.note::before {
  content: "Note: ";
  font-weight: bold;
}

Official CSS 3 documentation

More selectors and the box model commands

All selectors and the box model commands · CSS 3 cheatsheet

Was this page helpful?