Suscriber with us



Receive HTML?

Syndicate

HTML Entities PDF Print E-mail

HTML Character Entities

Some characters like the < character, have a special meaning in HTML, and therefore cannot be used in the text.To display a less than sign (<) in HTML, we have to use a character entity.

Character Entities

Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag.If we want the browser to actually display these characters we must insert character entities in the HTML source.A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon (;).To display a less than sign in an HTML document we must write: < or &#60;

The advantage of using a name instead of a number is that a name is easier to remember. The disadvantageis that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.Note that the entities are case sensitive. This example lets you experiment with character entities: Character Entities

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 spaces to your text, use the   character entity.

The Most Common Character Entities:

Result

Description

Entity Name

Entity Number

 

non-breaking space
 

 

&#160;

 
 

less than

<

&#60;


 

greater than

>

&#62;

&
 

ampersand

&

&#38;

"
 

quotation mark

"

&#34;

'
 

apostrophe 

' (does not work in IE)
 

&#39;

Some Other Commonly Used Character Entities:

Result

Description

Entity Name

Entity Number

¢
 

cent

¢

&#162;

£
 

pound

£

&#163;

 ¥
 

yen

¥

&#165;


 

euro

&#8364;

§
 

section

§

&#167;

©
 

copyright

©

&#169;

®
 

registered trademark
 

®

&#174;

×
 

multiplication

×

&#215;

÷
 

division

÷

&#247;





Digg!Del.icio.us!Google!Live!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Yahoo!Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated ( Friday, 14 March 2008 )
 
< Prev   Next >

HTML EXAMPLES

Examples

Polls

Which is the best Scripting language?