As mentioned above, specific characters in HTML must be replaced with entity characters. In addition, characters not found on the keyboard can be replaced by entity characters. In the article below, Taimienphi.vn will introduce to you Entities (entity characters) in HTML.
Learn about Entities entity characters in HTML
first. Entities (entity characters) in HTML
– Some characters are available and reserved in HTML.
– In case if we use smaller or larger markers in the text, the browser can mix these marks with tags.
– Entity characters are used to display reserved characters in HTML.
– Entity characters in HTML look like this:
To display the smaller sign, we use or.
Advantages and disadvantages of using entity names
– The advantage of using entity names is very easy to remember.
– The downside is that the browser may not support all entity names but only some.
2. Non-breaking Space characters in HTML
Common entity characters used in HTML include: (is a non-breaking space character).
Non-breaking space characters are not broken into new lines.
2 words separated by non-breaking space characters will not stick together (but not break into new lines).
– § ten
– 10 km / h
– 10 PM
In addition, non-breaking space is also used to prevent browsers from truncating whitespace on HTML pages.
Assuming we use 10 spaces in the text, the browser will remove 9 of those 10 spaces. To add whitespace to our text, we can use entity characters .
Non-breaking hyphen characters (-) Allows use of hyphen characters (-) without breaking.
3. Some useful entity characters in HTML
The following is a list of useful entity characters in HTML:
Note: Entity names are case sensitive.
4. Combining special marks
– Diacritical mark (diacritical mark) is a character added to the letter.
– Special marks such as (̀) or (́) are called accents.
– Special marks may appear above and below a letter, inside a letter and between two letters.
– Special marks can be used in combination with alphanumeric characters to create characters that are not in the encoding used in the page.
For example: Here are some examples of combinations of special characters in HTML: