HTML Entities

By | January 20, 2020

There are some words reserved in HTML which we cannot use directly. If you use Less Than (<) or Greater Than (>) then the browser may get some error in it and some words are not present on the keyboard like copyright sign (©). There are some such type of venom characters, and to display these venom characters, there are poison codes in the HTML. Hence the HTML units provide a series of letters. For these words we use the letter organizations of HTML.

Non-breaking space:-


The above sign is of non-breaking space, it does not allow the line to break, without breaking the line, it gives space between the two words in that line.


	<h1>This is h1&nbsp;heading.</h1>

In the above example, we have inserted this code between h1 and heading which gives a space in it without breaking the line, which can be output as follows.



Use an Entity:-

In this, let us see how we can use these codes of HTML. Each unit starts with ampersand (&) and ends with semicolon (;). Entity names are case sensitive. Below are some examples.

Result   Description                  Entity Name       Entity Number
         non-breaking space           &nbsp;	         &#160;

  &      ampersand                    &amp;              &#38;

  <      less than                    &lt;               &#60; 

  >      greater than                 &gt;               &#62;

  "      double quotation mark        &quot;	         &#34;

  '      apostrophe                   &apos;             &#39;

  ¢      cent                         &cent;             &#162;

  £      pound                        &pound;            &#163;

  ¥      yen                          &yen;              &#165;

  €      euro                         &euro;             &#8364;	

  ©      copyright                    &copy;             &#169;

  ®      registered trademark         &reg;              &#174;

Diacritical Marks:-

Some such syllable letters are found in HTML which add glyph below or above the letter.

Some Examples:-

Mark           Character               Construct         Result

  ̀             a                       a&#768;              à      

  ́             a                       a&#769;              á   

  ̂             a                       a&#770;              â  

  ̃             a                       a&#771;              ã 

  ̀             O                       O&#768;              Ò

  ́             O                       O&#769;              Ó 

  ̂             O                       O&#770;              Ô

  ̃             O                       O&#771;              Õ 

Leave a Reply

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