Web Design Made Simple Web Design Made Simple

debbie T Designs - Web Design Made Simple

Special Characters

Special characters like > < & and " should not be typed as is on a web file. To display them in web page text, a special code must be used. The browser will then render the code and display the character.

Here is a brief list of a few popular special characters codes:

Code Renders As Description
&amp; & Ampersand
&quot; " Double quote
&lt; < Left Bracket (less than)
&gt; > Right Bracket (greater than)
&nbsp; [space] non-breaking space will add
extra space to your text.
&copy; © Copyright symbol
&frasl; Slash
&reg; ® Registered Trademark
&deg; ° Degree
&frac12; ½ Half fraction

Each special code starts with an & (ampersand) character and ends with a ; (semi-colon.)

Here is a paragraph using some special characters:

Mindy said, "Let’s split ½ this pizza with Jack & Mike."

Here is the (X)HTML code:

<p>Mindy said, &quot;Let's split &frac12; this pizza with Jack &amp; Mike.&quot;</p>

Validation Errors Caused by URLs with & in the File Name

You might have received validation errors when validating your anchor tags containing URLs such as http://www.kraftfoods.com/main.aspx?s=product&m=product that included an ampersand "&" in the middle of the file address.

To fix this, just edit the url. Change the & to the special character of &amp; and the link will still work, plus your page will validate.

http://www.kraftfoods.com/main.aspx?s=product&amp;m=product

Helpful Links

There are a lot more special character codes to play with. Here are two sites that have some great lists of characters codes.

  • The W3C character list This page lists the numeric codes for each character. These codes work just the same.
  • Web Monkey has a has a very thorough list, but be aware that many might not display on older browsers like Netscape 4. I believe most modern browsers will have no problem with these codes, but use caution when using the first section of characters if you know that some web visitors are using older browsers.

What do you want to learn next? « Text QuotesMeta Tags »

Leave a Comment

If you would like to make an observation or suggestion, please take the time to write a comment. If you prefer to contact me privately, there is a contact form.