ASCII Character Set
HTML and XHTML documents use the standard 7-bit ASCII
character set in their source. The first 31 characters in ASCII (not
listed) are such device controls as backspace (
) and carriage return (
) and are not appropriate for use in
HTML documents.
HTML 4.01 defines only four entities in this character range: less
than (<
, <
), greater than (<
, >
), ampersand (&
, &
), and quotation mark ("
, "
), that are necessary for escaping
characters that may be interpreted as markup. XHTML also includes the
'
entity that is included in
every XML language. In XHTML documents, the ampersand symbol (&
) must always be escaped in attribute
values. For better compatibility with XML parsers, authors should use
numerical character references instead of named character references for
all other character entities.
Decimal |
Hex |
Entity |
Symbol |
Description |
---|---|---|---|---|
|
|
Space | ||
|
|
! |
Exclamation point | |
|
|
|
" |
Quotation mark |
|
|
# |
Octothorpe | |
|
|
$ |
Dollar symbol | |
|
|
% |
Percent symbol | |
|
|
|
& |
Ampersand |
|
|
XML/XHTML only:
|
' |
Apostrophe (single quote) |
|
|
( |
Left parenthesis | |
|
|
) |
Right parenthesis | |
|
|
* |
Asterisk | |
|
|
+ |
Plus sign | |
|
|
, |
Comma | |
|
|
- |
Hyphen | |
|
|
. |
Period | |
|
Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.