Adding HTML entities using CSS content

nickf picture nickf · Oct 10, 2008 · Viewed 447.4k times · Source

How do you use the CSS content property to add HTML entities?

Using something like this just prints   to the screen instead of the non-breaking space:

.breadcrumbs a:before {
    content: ' ';
}

Answer

mathieu picture mathieu · Oct 10, 2008

You have to use the escaped unicode :

Like

.breadcrumbs a:before {
    content: '\0000a0';
}

More info on : http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/