Live Traffic

Tuesday, May 10, 2011

Home » » HTML Character Entities

HTML 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 place of the actual characters themselves.

The Most Common Character Entities



A character entity has three parts: an ampersand (&), an entity name or an entity number, and finally a semicolon (;). The & means we are beginning a special character, the ; means ending a special character and the letters in between are sort of an abbreviation for what it's for. To display a less than sign in an HTML document we must write: < or < The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.

Note : Entities are case sensitive.


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 add 10 spaces in your text, HTML will remove 9 of them. To add spaces to your text, use the   character entity.



To see a list of character entities, visit this page:
http://profdevtrain.austincc.edu/html/entities.htm

0 komentar:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More