CSS reads \f086 as a string, not as an escape sequence. The fix is ββto use it directly inside the content attribute, for example content: '\f086'; , or directly copy and paste the icon into the HTML attribute (make sure you save the file as UTF-8)
HTML:
<div data-background-icon="ο"></div>
CSS
div::before { content: attr(data-background-icon); font-family: "FontAwesome"; }
OR use HTML objects:
HTML:
<div data-background-icon=""></div>
CSS
div::before { content: attr(data-background-icon); font-family: "FontAwesome"; }
Fiddle: https://jsfiddle.net/76v9e2ur/1/
source share