Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Design    Internet

Entering special characters

There are some special characters that you might want to use on your page but that you can't type in. This might be because the browser doesn't interpret them or because they don't appear on the keyboard. For example, browsers see a greater-than (>) sign as the start of a tag and so make a mess of the page if you just type the character in.

You can display these special characters (such as ampersand, the less-than sign, the greater-than sign and the copyright symbol) in your document but you need to enter a special code.

You always enter the code for a special symbol between an ampersand and a semi-colon. For example, if you want to display a left hand angle bracket, you simply enter the code that displays the < symbol: &lt;.

The most common special character in HTML is the non-breaking space. Normally, HTML truncates spaces in your text. If you put ten spaces in your text, HTML removes 9 of them. To add spaces to your text, use the &nbsp; code.

Here is a list of some of the most common special characters:

This code…

Displays…

&lt;

<

&gt;

>

&amp;

&

&nbsp;

No break space

&quot;

&copy;

©

&reg;

®

&trade;

&pound;

£

&frac12

½

&frac14

¼

For a full list of available symbols, see Character sets.