Search

Advertisement

Articles

Home Special Characters

Using Special Characters



Occasionally, you might want to use a character on your webpage which isn't on a standard keyboard, such as © or ¾ . Or you might want to write a tutorial on how to use the font tag, but how do you make the word <FONT> show up on your page? If you type the tag in your source code, the browser will render it as HTML and it'll be invisible on your web page. Quite a quandry, isn't it?

The answer is to use special characters. There's an entire table of charactes called the ISO Latin-1 Table. You can display any of the characters on this table by typing either a Character Reference or an Entity Reference In place of the character.

 


 

Character References

A character reference consists of an ampersand (&) followed by a hash mark (#) then a numerical code, and finally a semicolon (;).

 

&#62;

This particular Character Reference gives you a lesser-than (<) character.

 


 

Entity References

Entity References are similar, except ther's no hash mark, and in place of numbers you have a descriptive word. This is ALWAYS followed by a semicolon. (Just like with a character reference).

 

&copy;

This reference gives you a copyright © symbol.

 

 


 

Which Is Best?

I like character references, but this is strictly a personal preference.

Some characters can only be displayed with character references, and I just have this idea in my head that fewer browsers support entity references. This isn't based on anything solid, just my own ideas, which can get really wacky sometimes, so decide for yourself.

 


 

How Do I...?

I think the handiest thing you can do with this stuff is insert a blank space, or even several in a row. For a blank space, simply type this:

 

&nbsp;

Surprise quiz - Is this a character reference or an entity reference?

If you said entity reference, you're right.

How about angle brackets?

The Lesser Than sign, as we said before, is written like this:

 

&#60;

The Greater Than sign is written:

 

&#62;

So If you want your visitor to see a font tag, you would write this in your source code:

 

&#60;FONT&#62;

There are a ton of characters which you can display with references. For a pretty thorough list, take a peek at the

 

Special Characters Table

Advertisement