MDN self-hosted library · e01.org

Use CSS generated content

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
A text where I need to <span class="ref">something</span>
css
.ref::before {
  font-weight: bold;
  color: navy;
  content: "Reference ";
}
html
<a href="developer.mozilla.org" class="glossary">developer.mozilla.org</a>
css
a.glossary::after {
  content: " " url("glossary-icon.gif");
}