Special characters in HTML

You may need to use special characters in an HTML document. For example, you might need an accented í if you are writing in Spanish.

You might also want to use a special character like "<" that has a special meaning in HTML. Putting a < in the middle of an HTML document would confuse the client program because it would not know whether you wanted the character < to appear or you were starting a tag.

This is the format of special characters:

&<key word>;

They begin with an ampersand (&) and end with a semicolon (;) and a key word indicating the special character is in the middle.

For example, if we use the key word "larr" we get a left arrow (←).

As we have seen, HTML generally ignores spaces in many places. You can force it to insert a space using the very handy special character

&nbsp;

You can see examples by viewing the source of this page.

If you do that, you will also see a new tag: <xmp>. That tag stops the browser from interpreting HTML codes and display whatever follows without changing its appearance.

Click here for a reference page on special characters in HTML.