1. Computing & Technology

Discuss in my forum

How to Use Special Characters in HTML

Move Your Site Beyond Plain Text

By , About.com Guide

When you're using HTML, you can type most text characters without using any special codes. But how do you render the text elements that HTML uses to be HTML, like < and >? And what about characters that don't have a direct analog on the keyboard, like © and Ñ?

These are called "special characters", and HTML renders them with numeric or character encoding so that they can be included in an HTML document.

Special HTML Characters

There are three characters that you shouldn't leave unencoded within your HTML documents. If you do, they can confuse the browsers and your pages may not render as you expect.

  • less-than sign <
  • greater-than sign >
  • ampersand &
  • quotation mark "

Instead of typing these characters directly into your HTML code, you need to type in the HTML encoding reference to them:

  • less-than sign & lt;
  • greater-than sign & gt;
  • ampersand & amp;
  • quotation mark & quot;

Special Characters You Can't Type

Any character that can be rendered in the Latin-1 standard character set, can be rendered in HTML. You simply enter an ampersand (&) and either its standard entity name or a pound-sign (#) and it's numerical code.

Some character sets include:

Non-English Language Characters

There are also a lot of characters in non-English languages that can be expressed in HTML.

Previous Features

©2012 About.com. All rights reserved.

A part of The New York Times Company.