This question already has an answer here:
- Adding HTML entities using CSS content 9 answers
I have a problem. I have found the HTML code for the downwards arrow, ↓
(↓)
Cool. Now I need to use it in CSS like so:
nav a:hover {content:"&darr";}
That obviously won't work since ↓
is an HTML symbol. There seems to be less info about these "escaped unicode" symbols that are used in css. There are other symbols like \2020
that I found but no arrows. What are the arrow codes?
Why don't you just save/serve the CSS file as UTF-8?
If that's not good enough, and you want to keep it all-ASCII:
The general format for a Unicode character inside a string is
\000000
to\FFFFFF
– a backslash followed by six hexadecimal digits. You can leave out leading0
digits when the Unicode character is the last character in the string or when you add a space after the Unicode character. See the spec below for full details.Relevant part of the CSS2 spec:
Comprehensive list: Unicode Character 'DOWNWARDS ARROW' (U+2193).