Slide 2.29: HTML meta
Slide 2.31: HTML URLs and URL encoding
Home

HTML Character Entities


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

Character Entities
A character entity has three parts: To display a less than sign in an HTML document, use &lt; or &#60;.

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
The HTML Entities Reference gives a full list of HTML character entities.

Result Description Entity Name Entity Number Result Description Entity Name Entity Number
  non-breaking space &nbsp; &#160; < less than &lt; &#60;
> greater than &gt; &#62; & ampersand &amp; &#38;
" quotation mark &quot; &#34; ' apostrophe  &apos; &#39;
¢ cent &cent; &#162; £ pound &pound; &#163;
¥ yen &yen; &#165; § section &sect; &#167;
© copyright &copy; &#169; ® registered trademark &reg; &#174;
× multiplication &times; &#215; ÷ division &divide; &#247;


Demonstration
The following demonstration shows how the HTML script is displayed on the Web.