Bookmark and Share

HTML Character Entities

An "entity" is a fancy term for a symbol. Several symbols, such as copyright, trademark, or foreign cash symbols, exist on your standard keyboard, so you need to display these characters using a different method.

Advertise on Tizag.com

There are three parts to every entity.

  • Each begins with a ampersand - &
  • Then the entities name - copy
  • And finally a semicolon - ;

Copyright:

Combine © to make - © - Copyright symbol.

Expect complications if you forget to include all three parts of an entity.

More Entities:

¢Cent¢¢
£English Pound££
¤Currency¤¤
¥Yen¥¥
®Registered Trademark®®
°Degree(s)°°
±Plus or Minus±±
¼¼ Fraction¼¼
½½ Fraction½½
¾¾ Fraction¾¾

View a more complete list at: Entities Table

Additional Spaces and <>.

Regardless of how many spaces you place between words, your web browser will only render a single space. To get around this, use the non-breaking space character entity.

HTML Code:

<p>Everything that goes up, must come &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; down!</p>

Spaces:

Everything that goes up, must come       down!

In HTML, we use less than and greater than characters to create tags, so to use them on your website you will need entities.

HTML Code:

<p>
Less than - &lt; <br />
Greater than - &gt; <br />
Body tag - &lt;body&gt;
</p>

Less than Greater than:

Less than - <
Greater than - >
Body tag - <body>

Take a few minutes to view and play with the symbols listed in the Entities Table.

Bookmark and Share


Tips

  • Names or Numbers? After looking at our entities table you probably noticed that there is a number value and a name value for each entity. Some older browsers do not support name values, but it is not likely that someone will run into this problem today.
  • Remember to use the entity code for < and > within your text. Otherwise you might find strange errors occurring all over the place that you can't pinpoint.


Found Something Wrong in this Lesson?

Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!

Advertise Here

More Tutorials!
Microsoft Office Tutorials Artist Tutorials