Easy learning with example program codes

HTML Entities

To replace the reserved characters in HTML, as well as to replace the characters that are not present on a keyboard, the HTML character entities are used. It thus provides a wide range of characters to add icons, geometric shapes, mathematical operators, etc. To use an entity in an HTML document one can either use it by name or by a numerical character reference. The ampersand (&) and the semicolon (;) symbols are used to start and end an entity respectively.





Advantages of using Entity Name:

It is easy to remember an entity name.

Disadvantages of using Entity Name:

All entity names may not be supported by every browser. However, the support for the entity numbers is good.

Popular HTML Character Entities:

ResultDescriptionEntity NameEntity Number
non-breaking space  
<less than&lt;&#60;
>greater than&gt;&#62;
double quotation mark&quot;&#34;
single quotation mark (apostrophe)&apos;&#39;
®registered trademark&reg;&#174


<!DOCTYPE html>  
<p>&#34;HELLO WORLD!!&#34;</p>  
<p>&#60;HELLO WORLD!!&#62;</p>  



In the above example, we used the Entity Number to replace the reserved character in HTML.

HTML Diacritical Marks:

The “glyph” added to the HTML letters to the top or below the letters, inside a letter, or between two letters, is called the HTML diacritical mark. The HTML Diacritical marks, like grave ( ̀) and acute ( ́) are often known as accents. Some of the HTML diacritical marks are:

Please follow and like us:
Posted in HTML   

Copyright © 2020 CodesJava Protection Status