Using Special Characters with HTML




If you use special characters, such as <, >,and /, in an HTML document, the browser may translate these characters as HTML tags and not display the characters properly. To ensure that special characters are displayed properly, use the HTML character code instead of typing the character itself. Each character code begins with an ampersand (&) and ends with a semicolon (;). You do not need to place the character code within tags.

The following table contains some commonly-used special characters and their corresponding character code.

Character
Description
Character Code
  space &#32;
! exclamation mark &#33:
" double quotation mark &#34:
# number sign &#35;
$ dollar sign &#36;
% percent sign &#37;
& ampersand &#38;
' apostrophe &#39;
( left parenthesis &#40;
) right parenthesis &#41;
* asterisk &#42;
+ plus sign &#43;
, comma &#44;
- hyphen &#45;
. period &#46;
/ slash &#47;
: colon &#58;
; semicolon &#59;
< less-than sign &#60;
= equals &#61;
> greater-than sign &#62;
? question mark &#63;
@ at sign &#64;
[ left square bracket &#91;
\ backslash &#92;
] right square bracket &#93;
_ underscore

&#95;

~ tilde

&#126;