Latest web development tutorials

HTML character entities

The HTML reserved characters must be replaced with character entities.

Some characters not found on the keyboard can also be used to replace the use of character entities.


HTML entities

In HTML, certain characters are reserved.

In HTML, you can not use less than sign (<) and greater than (>), this is because the browser will mistakenly think they are labels.

If you want to correctly display reserved characters, we must use character entities (character entities) in the HTML source code. Character entity like this:

&entity_name;

&#entity_number;

To display a less than sign we mustwrite: & lt; or & # 60;or& # 060;

RemarkTip: Use thename of the entity rather than the digital advantage is that the name is easy to remember. But the downside is, the browser may not support all entity names (support for entity numbers is very good).


Nonbreaking space (Non-breaking Space)

HTML character entities are commonly used non-breaking space (& nbsp;).

The browser will always truncate spaces in HTML pages. If you write 10 spaces in the text, before displaying the page, the browser will remove 9 of them. To increase the number of spaces on the page, you need to use & nbsp; character entities.


Combined phonetic symbols

Diacritical mark is added to a letter on the "glyph (glyph)."

Some diacritical marks, such as acute accent () and grave ().

Diacritical marks may appear above and below the letters or letter inside, or between two letters.

Umlauts can be letters, numbers, and characters to use.

Here are some examples:

音标符 字符 Construct 输出结果
   a a&#768; a
   a a&#769; a
   a a&#770; a
   a a&#771; a


HTML character entities

Note

The entity name is case-sensitive!


Display results description Entity name Entity ID
Blank & Nbsp; & # 160;
< Less than sign & Lt; & # 60;
> Greater than sign & Gt; & # 62;
& And number & Amp; & # 38;
" quotation marks & Quot; & # 34;
' apostrophe & Apos; (IE not support) & # 39;
¢ Minute & Cent; & # 162;
£ pound & Pound; & # 163;
¥ JPY & Yen; & # 165;
EUR & Euro; & # 8364;
§ Section & Sect; & # 167;
© copyright & Copy; & # 169;
® Trademark & Reg; & # 174;
trademark & Trade; & # 8482;
× Multiplication sign & Times; & # 215;
÷ Sign of division & Divide; & # 247;

View full site HTML entities: Click on HTML entity reference manual .