Avant le contenu de l'attribut

/* html */
<p data-foo="Lorem Ipsum"></p>

/* css */
[data-foo]::before {
  content: attr(data-foo);
}
Rudolph Steyn