HTML Entities
Some characters are reserver in html.
If you use the less than (<) or greater than (>) signs in your text, the browser might mix them with tags.
character entities are used to display reserved characters in html.
A character entity looks like this:
&entity_name;
OR
&#entity_number
To display a less than sign (<) we must write: < or <
Advantages of using an entity name: An entity name is easy to remember.
Disadvantages of using an entity name: Browsers may not support all entity names, but the support for entity numbers is good.
Some usefull HTML Character Entities
| Result | Description | Entity Name | Entity Number |
|---|---|---|---|
| non-breaking space | | &#160; | |
| < | less than | < | < |
| > | greater than | > | > |
| & | ampersand | & | &38; |
| " | double quotation mark | " | " |
| ' | single quotation mark (apostrope) |
' | ' |
| ¢ | cent | ¢ | ¢ |
| £ | pound | £ | £ |
| ¥ | yen | ¥ | ¥ |
| € | euro | € | € |
| © | copy | ©right | © |
| ® | registerd trademark | ® | ® |
Note: Entity names are case sensitive.
Combining Diacritical Marks
A Diacritical mark is a "glyph" added to a letter.
Some diacritical marks, like grave(̀) and acute (́) are called accents;
Diacritical marks can appear both above and below a letter, inside a letter, and between two letters.
Diacritical marks can be used in combination with alphanumeric characters to produce a character that is not present in the character set (encodin) used int the page.
Here are some examples:
| Mark | Character | Constants | Result |
|---|---|---|---|
| ̀ | a | à | à |
| ́ | a | á | á |
| ̂ | a | â | â |
| ̃ | a | ã | ã |
| ̀ | O | Ó | Õ |
| ́ | O | Ó | Ó |
| ̂ | O | Ô | Ô |
| ̃ | O | Õ | Õ |
Comments
Post a Comment
If you have any doubt feel free to text me.