Loading Please Wait...

Logo Lynxsia IT Solutions

HTML Entities

HTML Entities

HTML have some reserved keywords for the syntax such as less than, greater than, etc. We can not write these keywords on the webpage. To include these keywords, HTML provided entity codes.

For example, we want to write some comparison but when we use less than (<) or greater than (>), the browser get confuse and treat them as HTML tag. In such situation we use HTML entities.

HTML entity can be added by either using entity name or entity code number or hexadecimal value.

Common Syntax
					 
        
          &entity_name
          OR
          &#entity_code
        
      

For example to display less than (<), use &lt; or &#60;

Entity name is easy to remember but some entity name is not recognize by all the browsers. While Entity code number is supported by all the browsers.

Non-breaking Space - &nbsp;

If we want to write more than 1 space in our text then browser ignore all the extra space and truncate the text. To achieve this we can use non-breaking space &nbsp;

Another use case of non-breaking space is when we want text to stick together and not break into new line such as 10 kg, $ 100.

Without using non-breaking space, they may break and appears in new line. 10 appear in one line and kg appears in new line.

With non-breaking space, they stick together. If there is need of line break then the whole 10 kg appears in new line.

Common HTML Entities
Name Code Description Output Test Online
&nbsp; &#160; Non-breaking space   Test Online
&hyphen; &#8209; Non-breaking hyphen Test Online
&lt; &#60; Less than < Test Online
&gt; &#62; Greater than > Test Online
&amp; &#38; Am percent & Test Online
&copy; &#169; Copyright © Test Online
&trade; &#8482; Trademark Test Online
&euro; &#8364; Euro sign Test Online
HTML Entity names are case sensitive. &copy; and &Copy; and &COPY; are three different things.
Learn more about HTML entities and symbols in our HTML Symbols Tutorials

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved