Special characters in CSS :before and :after pseudo-classes

28 September 2011

Using special characters in CSS pseudo-classes like :before and :after can be quite tricky if you don't know what's the catch.

I bet you've tried using HTML special characters like this:

blockquote:before {
    content: "«";

And that didn't work? That's because it expects an escaped unicode hexadecimal character value, like this:

blockquote:before {
    content: "\0201C";

This find out which unicode character belongs to what html character, see this ANSI character set.
You must have JavaScript enabled to use this form!

Leave a comment!

  1. Your mail is safe with me. It's only only used to display your Gravatar image!


Please feel free to be the first to comment on this page!

By placing a comment you let me know i'm doing a good job. It doesn't have to be constructive, just a "awesome!" makes me really happy! You contribute to a better world!