Web Design Lesson 008 – HTML Entities

HTML Entities

HTML Entities are used for denoting reserved characters in the language.

Reserved characters

Like programming languages which have reserved words and operators, HTML has reserved characters . If you want to
use text in html formed using such characters , you need special ways of denoting it, else it will be confused as a character which is part of html syntax and hence will take a different meaning.

In above example we find characters <,> and / apart from alphanumeric characters.

In order to use a reserved character as text in HTML, you need to use an appropriate HTML character entity.

Following are some character entities:

< less-than sign  -> &lt or &#60 
> greater-than sign  -> &gt or &#62 
≤ less-than or equals sign  -> &le 
≥ greater-than or equals sign  -> &ge  
&nbsp (non breaking space , means space on same line, if 2 words are separated by this they will always remain together on same line)

& ampersand -> &amp or &
" double quotation mark -> &quot or "
' single quotation mark (apostrophe) -> &apos or '
¢ cent -> &cent or ¢
£ pound -> &pound or £
¥ yen -> &yen or ¥
€ euro -> &euro or €
© copyright -> &copy or ©
® registered trademark -> &reg or ®

Leave a Reply

Your email address will not be published. Required fields are marked *