HTML #4 - HTML Entities Introduction and some examples
Hello friends, welcome to the another tutorial of programming infinity. In this tutorial, we will know about the entities, its uses and some of the entity names and also the number that can be used in place of characters in HTML. so friends, let's begin...
ENTITIES
Entities in HTML means a piece of code which is used in the place of Reserved Characters like "<" etc. It is recommended to use entities instead of characters, as for example, if we use "<" or ">" directly in HTML for the value of any attributes or any another thing, the web browsers will consider it as a tag and the HTML code wilg l rais e.g.e an error and it will not be seen as designed. Its advantage is that, it can be easily remembered and we can use that special characters that are not on the keyboard like "©". As we know that everything has advantage and disadvantage, the entity name is not recognised by some browsers, but this is not a big issue, because we can use entity number which is supported by all browsers. Below is given the simple structure of entity name/number. we had to only replace the entity_name/entity_number with the proper name/number.
&entity_name;
OR
&#entity_number;
e.g. - < = "<"
SOME COMMON ENTITIES
:-
It is used for adding Non-breaking line space i.e. adding space between words or characters in the same line, means without adding a new line.
e.g. - ONE APPLE.
< :-
It is used to add "<" symbol in HTML.
e.g. - 1<2.
> :-
It is used to add ">" symbol in HTML.
e.g. - 4 > 1.
SOME HTML ENTITIES
Result | Description | Entity name | Entity Number |
---|---|---|---|
non-breaking space | |   | |
< | less than | < | < |
> | greater than | > | > |
& | ampersand | & | & |
" | double quote | " | " |
' | single quote | ' | ' |
¢ | cent | ¢ | ¢ |
£ | pound | £ | £ |
¥ | yen | ¥ | ¥ |
€ | euro | € | € |
© | copyright symbol | © | © |
® | registered trademark | ® | ® |
™ | trade mark | ™ | ™ |
← | left arrow | ← | ← |
↑ | upward arrow | ↑ | ↑ |
→ | right arrow | → | → |
↓ | downward arrow | ↓ | ↓ |
Note:- Entity names are case Sensitive.
Comments
Post a Comment