2012-09-02 10:12 pm
Entry tags:

HTML escape sequences and content-before

I wanted to use use a stylesheet to add an &mdash before certain content on a web page. This should be easy with modern CSS, but span.foo:before{ content: '— '} places the text — on the web page as if the CSS engine ran the string through a sanitizer and is giving me — instead.

A Stack Overflow discussion says I need to know the character's Unicode value and use that instead. This is stupid.

Useful reference: numeric values of all named HTML escape sequences.