it19
Would you like to react to this message? Create an account in a few clicks or log in to continue.

HTML Entities

Go down

HTML Entities Empty HTML Entities

Post by Wingedge Sat Aug 09, 2008 11:39 pm

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 (Wink.

To display a less than sign in an HTML document we must write: &lt; 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 that the 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 write 10 spaces in your text HTML will remove 9 of them. To add spaces to your text, use the &nbsp; character entity.



The Most Common Character Entities:
HTML Entities F_1m_341af26

Some Other Commonly Used Character Entities:

HTML Entities F_2m_f6c4db9

ISO 8859-1 Symbol Entities
HTML Entities F_4m_e52d288
ISO 8859-1 Character Entities
HTML Entities F_4m_e52d288
Wingedge
Wingedge
Admin

Male
Number of posts : 53
Age : 40
Name : Sir Francis
Year : Instructor
Registration date : 2008-06-17

https://it19.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum