HTML Entities - Entity characters in HTML

Characters that need to be preserved in HTML will be replaced with character entities - Entities.

Characters that need to be preserved in HTML will be replaced with character entities - Entities. It is also possible to use character entities to write characters that are not on the keyboard.

Entity in HTML

In HTML, some characters need to be preserved. If you use a smaller (<) or greater (>) sign in the text, the browser may mistake it for HTML tags. Character entities are used to display these characters.

 & ten_thucthe; 
OR
_thucthe

To write a smaller sign (<) you can write < or <

The benefit of using an entity name is very easy to remember, but the downside is that the browser may not support all entity names but with numbers.

The space is not interrupted

A familiar character entity in HTML is unbroken space, or space itself:

This is a space that cannot be separated into a new line. Two words on both sides of this white space will always go together.

 § 10 

Another familiar case is to use this non-destructive space to prevent the browser from deleting the whitespace on the HTML page. If you type 10 spaces, the browser will delete 9 of them. To add real white, use  There are also indestructible hyphens help create hyphens (-) not destroyed.

Some character entities are useful in HTML

Result Description Entity name Number of blank entities not destroyed larger mark>> & ampersand & & "double quotation marks" "'single quotes'' ¢ cents ¢ ¢ £ pound pound £ £ yên yen ¥ ¥ € euro euro © copyright characters © © registered trademarks ® ®

Note: The entity name differs between uppercase and lowercase letters.

Combined with diacritics

Extra diacritics are added to letters that often represent dialectal letters, which can be above, below, inside letters, or between two letters. They can use the same numeric character to create characters that are not in the character set in the page. Here are some examples.

Character Sign Code Result ̀ a à ́ á â â â ̃ ã ã Ò O ò Ò O Ó Ó ̂ O O O ̃ O Õ Õ

Previous article: Computer code element in HTML

The following article: Icon in HTML

5 ★ | 1 Vote