Search code examples
htmlcssentities

How to use html entities in CSS content property?


Good day,

I'm stuck with a problem this morning. I found out that content property which is nice but I can't use HTML entities in it.

More specifically, I would like to use the é

This is what I tried: content: 'test with eacute \233'; but the result is test with eacute ÿ

I've also tried \0233, \0233c, \233c

I don't want to change my page's encoding.

Thank you in advance guys!


Solution

  • Hmm I found that website : http://www.evotech.net/articles/testjsentities.html

    And it looks like the é (&eacute, &#233) is converted into \00E9

    And now, content: 'test with eacute \00E9'; works!