csscharacter-entities

css html entity


I'm trying to add an html entity (→ →) using css when a link is hovered with the following css:

#menu1 a:hover:after {
  content: "→";
}

But the output is just → instead of →. The same problem happens when using the decimal (8594) or the entity (rarr).

How do I include an HTML entity with css?


Solution

  • #menu1 a:hover:after {
      content:"\2192 ";
    }​
    

    Working example: http://jsfiddle.net/wCzUf/
    More details - Can you use HTML entities in the CSS “content” property?
    List of HTML entities - http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references