An HTML entity is a string that is used to display reserved and invisible characters, which would otherwise be treated as HTML code. HTML entities begin with an ampersand(&) and end with a semicolon(;). They are written as-
&entityName; or &#entityNumber;
HTML reserves some characters, and it is possible that the browser may misinterpret them as mark-up elements. There are also some characters that are not present on a standard keyboard but are desired on a web-page. For such situations, HTML entities prove to be highly beneficial. It is easier to remember an entity name than type from a standard keyboard.
For example, The less than sign,<, is written as < or <.
Let us suppose we want to write and display
on our webpage. We can write the characters ‘<’ and ‘>’ using the entity name or the numerical character reference.
#html tutorials #html entities #html