&entity_name; or &entity_number;
Second Defination: Many symbols and special characters are required while developing a web page in html, but as we know that sometimes the use of characters directly may interfere with the actual html code which have certain characters reserved and also certain characters being not available on keyboard. Thus, to avoid the conflict and at same time to be able to use different symbols in our code w3 org provides us with 'Character Entities'
Character Entities are predefined with 'Entity Name' - &entity_name; and 'Entity Number' - &entity_number; so we need to use either of the two for the required symbol to be rendered on our page.
A simple example with the use of character entity for 'magnifying glass' :
<input type="text" placeholder=" 🔍 Search"/>
Non-breaking Space is one the most usable Entity to adding space
In HTML if you write 5 spaces in your text , browser will remove all extra space and only one space is left in this case browser only display 1 space and remove 4 , that's why we use (Non-breaking Space) character entity
Example: without entity and with entity
| NUMBER | ASCII ANSI ISO-8859-1 UTF-8 | DESCRIPTION |
|---|---|---|
| 32 | space | |
| 32 | Space | |
| 33 | ! | Exclamation Mark |
| 34 | " | Quotation Mark |
| 35 | # | Hash Sign |
Share TDB SCHOOL
Share this E-Learning Website on social media platforms with your friends and followers