SPECIAL CHARACTERS



Text in webpages is made of the standard 256 ASCII characters, most of which can be found on your regular keyboard. There are a few exceptions, though.

There are also the characters that have special meaning in html, like the greater-than and less-than brackets that surround tags.

When you need to actually display one of these special characters, you have to do a little extra typing...

For example, to get < > to show up in the browser, you have to type 4 characters in the source code. All special character groups start with the ampersand (&) and end with a semi-colon (;).

Any of the 256 ASCII characters can be specified by a number preceeded by the # symbol. See figure 1 below for the various symbols and their respective numbers. Notice that some of the munbers, specifically 0-32 and 127-160 are not defined in this table. That's because those numbers are reserved for control characters and are inappropriate for use in html documents. Don't worry about them, you'll never have any reason to use them.

There are also various accented letters that have been specifically defined in html. See figure 2 below for these. Notice that this is one place in html where case matters. All of these characters, except for the sz ligature and y umlaut, come in both upper and lower case versions. For the upper case, use an upper case letter in the source code; ie: &Ouml; for Ö. For the lower case version, use a lower case letter in the source code; ie: &ouml; for ö.

There are also 6 additional characters specified for use in html that aren't accented letters. They are characters that the original builders of the language thought might come in handy. See figure 3 below.

Last of all is the blank character, the empty space. I've mentioned before that html doesn't see multiple spaces or carriage returns in the source code, treating them all as a single space, so if you actually want to put some extra   spacing   in your text you have to use a special character group for it. The code for a single space is &nbsp;.



fig. 1 The 256 ASCII Latin-1 characters

The ASCII Latin-1 characters



fig. 2 Accented characters in HTML.

&AElig; Æ &Aacute; Á &Acirc; Â
&Agrave; À &Aring; Å &Atilde; Ã
&Auml; Ä &Ccedil; Ç &ETH; Ð
&Eacute; É &Ecirc; Ê &Egrave; È
&Euml; Ë &Iacute; Í &Icirc; Î
&Igrave; Ì &Iuml; Ï &Ntilde; Ñ
&Oacute; Ó &Ocirc; Ô &Ograve; Ò
&Oslash; Ø &Otilde; Õ &Ouml; Ö
&THORN; Þ &Uacute; Ú &Ucirc; Û
&Ugrave; Ù &Uuml; Ü &Yacute; Ý
&szlig; ß &yuml; ÿ


fig. 3 Special characters in HTML.

&lt; < &gt; > &amp; &
&quot; " &reg; ® &copy; ©



previous next contents