HTML Special Characters
Special HTML characters
The markup language uses the character < to start a markup tag. The consequence of this is that < can not be used to represent the less than character directly in a web page. The HTML markup languages defines an escape sequences of characters to represent such special characters.
The following are some of the character sequences used to represent characters that have a special meaning in the HTML language.
| Character | Represent by sequence | Character | Represent by sequence | Character | Represent by sequence |
|---|---|---|---|---|---|
| < | < |
> | > |
|
|
| & | & |
" | " |
© | © |
Characters outside the normal ASCII set
Characters not in the normal ASCII character set are also represented by an escape sequence. This is so that they may be typed on computer systems which do not directly support the input of such characters. For example:
| Character | Represent by sequence | Character | Represent by sequence | Character | Represent by sequence |
|---|---|---|---|---|---|
| á | á |
ç | ç |
ë | ë |
Non breakable space
To prevent the web browser breaking a line at a space character a non breaking space character is used rather than the normal space character.. A non breaking space character is represented by the escape sequence . This can also be used to introduce more than one space character between words. For example:
| HTML | Formatted text |
|---|---|
| A B A B |
LATIN-1 character set
In addition a character from the LATIN-1 character set is represented by &#nn;. Where nn represents the character code in decimal. For example:
| Character | Represent by sequence | Character | Represent by sequence | Character | Represent by sequence |
|---|---|---|---|---|---|
| ! | ! |
" | " |
# | # |
| $ | $ |
% | % |
& | & |
| ' | ' |
( | ( |
) | ) |
| * | * |
+ | + |
, | , |
| - | - |
. | . |
/ | / |
| 0 | 0 |
1 | 1 |
2 | 2 |
| 3 | 3 |
4 | 4 |
5 | 5 |
| 6 | 6 |
7 | 7 |
8 | 8 |
| 9 | 9 |
: | : |
; | ; |
| < | < |
= | = |
> | > |
| ? | ? |
@ | @ |
A | A |
| B | B |
C | C |
D | D |
| E | E |
F | F |
G | G |
| H | H |
I | I |
J | J |
| K | K |
L | L |
M | M |
| N | N |
O | O |
P | P |
| Q | Q |
R | R |
S | S |
| T | T |
U | U |
V | V |
| W | W |
X | X |
Y | Y |
| Z | Z |
[ | [ |
\ | \ |
| ] | ] |
^ | ^ |
_ | _ |
| ` | ` |
a | a |
b | b |
| c | c |
d | d |
e | e |
| f | f |
g | g |
h | h |
| i | i |
j | j |
k | k |
| l | l |
m | m |
n | n |
| o | o |
p | p |
q | q |
| r | r |
s | s |
t | t |
| u | u |
v | v |
w | w |
| x | x |
y | y |
z | z |
| { | { |
| | | |
} | } |
| ~ | ~ |
? |  |
⬠| € |
| |  |
, | ‚ |
f | ƒ |
| ,, | „ |
... | … |
? | † |
| ? | ‡ |
^ | ˆ |
? | ‰ |
| S | Š |
< | ‹ |
OE | Œ |
| |  |
| Ž |
|  |
| |  |
` | ‘ |
' | ’ |
| " | “ |
" | ” |
* | • |
| - | – |
- | — |
~ | ˜ |
| [tm] | ™ |
s | š |
> | › |
| oe | œ |
|  |
| ž |
| Y | Ÿ |
  |
¡ | ¡ |
|
| ¢ | ¢ |
£ | £ |
¤ | ¤ |
| ¥ | ¥ |
¦ | ¦ |
§ | § |
| ¨ | ¨ |
© | © |
ª | ª |
| « | « |
¬ | ¬ |
| ­ |
| ® | ® |
¯ | ¯ |
° | ° |
| ± | ± |
² | ² |
³ | ³ |
| ´ | ´ |
µ | µ |
¶ | ¶ |
| · | · |
¸ | ¸ |
¹ | ¹ |
| º | º |
» | » |
¼ | ¼ |
| ½ | ½ |
¾ | ¾ |
¿ | ¿ |
| À | À |
Á | Á |
 |  |
| Ã | Ã |
Ä | Ä |
Å | Å |
| Æ | Æ |
Ç | Ç |
È | È |
| É | É |
Ê | Ê |
Ë | Ë |
| Ì | Ì |
Í | Í |
Î | Î |
| Ï | Ï |
Ð | Ð |
Ñ | Ñ |
| Ò | Ò |
Ó | Ó |
Ô | Ô |
| Õ | Õ |
Ö | Ö |
× | × |
| Ø | Ø |
Ù | Ù |
Ú | Ú |
| Û | Û |
Ü | Ü |
Ý | Ý |
| Þ | Þ |
ß | ß |
à | à |
| á | á |
â | â |
ã | ã |
| ä | ä |
å | å |
æ | æ |
| ç | ç |
è | è |
é | é |
| ê | ê |
ë | ë |
ì | ì |
| í | í |
î | î |
ï | ï |
| ð | ð |
ñ | ñ |
ò | ò |
| ó | ó |
ô | ô |
õ | õ |
| ö | ö |
÷ | ÷ |
ø | ø |
| ù | ù |
ú | ú |
û | û |
| ü | ü |
ý | ý |
þ | þ |
| ÿ | ÿ |
Review Questions
- Question 1 - What is the sequence for a non breakable space?
- Question 2 - Write the HTML to display
<br>on a web page