HTML Character Entities
Reserved characters in HTML must be replaced with character
entities.
Character Entities
Some characters are reserved in HTML. For example, you cannot use the greater
than or less than signs within your text because the browser could mistake them
for markup.
If we want the browser to actually display
these characters we must insert character entities in the HTML
source.
A character entity looks like this: &entity_name; OR &#entity_number;
To display a less than sign we must write: <
or <
The advantage of using an entity name instead of a number is that the name
often is easier to remember. However, the disadvantage is that browsers may not support
all entity names (while the support for entity numbers is very
good).
Non-breaking Space
The most common character entity in HTML is the non-breaking space.
Normally HTML will truncate spaces in your text. If you write 10 spaces in
your text HTML will remove 9 of them. To add lots of spaces to your text, use the
character entity.
Try It Yourself
This example lets you experiment with character entities:
Try it yourself
Commonly Used Character Entities
Note Entity names are case sensitive!
| Result |
Description |
Entity Name |
Entity Number |
| |
non-breaking space |
|
  |
| < |
less than |
< |
< |
| > |
greater than |
> |
> |
| & |
ampersand |
& |
& |
| ¢ |
cent |
¢ |
¢ |
| £ |
pound |
£ |
£ |
| ¥ |
yen |
¥ |
¥ |
| € |
euro |
€ |
€ |
| § |
section |
§ |
§ |
| © |
copyright |
© |
© |
| ® |
registered trademark |
® |
® |
For a complete reference of all character entities, visit our
HTML
Entities Reference.

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file, Excel 2007, XBRL, or Web services data.
Then it transforms data instantly or auto-generates royalty-free data integration code for recurrent conversions.
Download a free, fully functional 30-day trial to experience the following features:
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
Download a fully-functional trial today!
|
|
|
|