Special Character Encoding
For the most part, characters within documents that are not part of a tag are rendered as is by the browser. However, some characters have special meaning and are not directly rendered, and other characters can't be typed into the source document from a conventional keyboard. Special characters need either a special name or a numeric character encoding for inclusion in a document.
Special Characters
As has become obvious in the discussion and examples leading up
to this section, three characters in source documents have very
special meaning: the less-than sign (<), the greater-than sign (>), and the ampersand (&). These characters delimit tags and
special character references. They'll confuse a browser if left
dangling alone or with improper tag syntax, so you have to go out of
your way to include their actual, literal characters in your
documents.[*]
Similarly, you have to use special encoding to include double quotation mark characters within a quoted string, or when you want to include a special character that doesn't appear on your keyboard but is part of the ISO Latin-1 character set that most browsers implement and support.
Inserting Special Characters
To include a special character in your document, enclose
either its standard entity name or a pound sign (#) and its numeric position in the Latin-1
standard character set[*] inside a leading ampersand and an ending semicolon, without any spaces in between. Whew. That's a long explanation for what is really ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access