54

SOLVED - used \00a9 instead of ©

Pretty self-explanatory:

body:after {
    content: "© me";
    /* other formatting */
}

In HTML, the © sequence inserts a copyright character. Can this be done in CSS Pseudo-Elements like I'm trying to do here?

jstm88
  • 3,335
  • 4
  • 38
  • 55
  • possible duplicate of [CSS:after encoding characters in content](http://stackoverflow.com/questions/5030551/cssafter-encoding-characters-in-content) – Pekka Oct 14 '11 at 16:18

1 Answers1

92

CSS doesn't use HTML's entities; it uses its own unicode escape sequences.

You need to use \00a9 for the copyright symbol.

body:after {
  content:"\00a9 me";
}

See here for a cheat-sheet table which shows just about every entity/unicode string you'd ever need: http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/

Spudley
  • 166,037
  • 39
  • 233
  • 307
  • 2
    I just found my answer to a similar question which says the same thing. Now I feel really stupid to have answered this one differently. http://stackoverflow.com/questions/5030551/cssafter-encoding-characters-in-content/5030594#5030594 – BoltClock Oct 14 '11 at 16:17
  • 1
    url is dead. Check here for the list: https://css-tricks.com/snippets/html/glyphs/ – Cyril Mestrom Jun 30 '16 at 11:43
  • 1
    Cheat sheet provided didn't reference my symbols. This converter did the trick: https://r12a.github.io/apps/conversion/ paste code in top box, hit convert, and take the value under `css`. – Kiee Jul 28 '16 at 10:16
  • 1
    The cheat sheet didn't even provide a standard exclamation mark! Might I suggest using the following link - https://unicode-table.com – Neil Sep 13 '17 at 09:06