There are two primary methods of generating a character with HTML entities: that is, two ways of generating characters that your keyboard and/or a word processor does not produce by default. Both methods start with an ampersand character (&) and end with a semi-colon. They are keyword and decimal entities.
Keyword entities cover the most common characters, and are recognized by the majority of browsers. A few examples:
|a long dash – to separate two conjoined pieces of text||–|
|a short dash or hyphen - to join words or dates (e.g. 1939-45)||–|
|a leading quotation mark||“|
|a closing quotation mark||”|
Not every character has a keyword entity: the number of possible characters and symbols from every language is simply too great. Every character is also given a decimal entity: a code written in numbers. Sometimes these have keyword entity equivalents, but often not. Successful glyph representation is often more sensitive to font, browser, and OS selection. A minute sampling:
|open circle clockwise arrow||↺|
|right white arrow||⇨|
|vulgar fraction, three-fifths||⅗|
A few oddities
There are a few characters that remain problematic. The first two are the greater and less than sign: when you use < or > in a web page, the browser will assume that you are starting about the start or end of a tag. Use the keyword entities
> to create those.
The last is the ampersand character, for similar reasons – if we have an & in our document, the browser assumes we are going to start an HTML entity. You have a keyword entity for that too: