HTML character entity


Release date:2024-02-04 Update date:2024-02-23 Editor:admin View counts:55

Label:

HTML character entity

Reserved characters in HTML must be replaced with character entities.

Some characters that cannot be found on the keyboard can also be replaced with character entities.

HTML entity

In HTML, some characters are reserved.

The less than sign (<) and the greater than sign (>) cannot be used in HTML because browsers mistook them for tags.

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

& *entity_name*;
or
&# *entity_number*;

To display the less than sign, we must write: &lt; or &#60; or &#060;

Tip: the advantage of using entity names instead of numbers is that names are easy to remember. The downside, however, is that browsers may not support all entity names (entity numbers are well supported).

Non-breaking Space

The common character entities in HTML are uninterrupted spaces (& nbsp;).

Browsers always truncate spaces in HTML pages. If you write 10 spaces in thetext, the browser deletes 9 of them before displaying the page. To increasethe number of spaces in the page, you need to use the & nbsp; character entity.

Combined phonetic alphabet

A phonetic symbol is a “glyph” added to a letter.

Some consonant symbols, such as sharp notes and muted notes.

Consonant symbols can appear above and below the letter, or inside the letter, or between two letters.

Phonetic symbols can be used in combination with alphabetic and numeric characters.

Here are some examples:

Phonetic symbols

Character

Construct

Output result

Cymbal

A

Axiomatic 768

A month

Cymbal

A

Axiomatic 769

A month

Cymbal

A

Axiomatic 770

A month

Cymbal

A

Axiomatic 771

A month

Cymbal

O

Odyssey 768

O stories

Cymbal

O

Odyssey 769

O stories

Cymbal

O

Odyssey 770

O stories

Cymbal

O

Odyssey 771

O stories

HTML character entity

Entity names are case sensitive!

Display the results

Description

Entity name

Entity number

Space

& nbsp

& # 160

<

Less than sign

& lt

& # 60

>

Greater than sign

& gt

& # 62

&

And sign

& amp

& # 38

Quotation mark

& quot

& # 34

Apostrophe

& apos; (not supported by IE)

& # 39

To send

Points

& cent

& # 162

£

Pound

& pound

& # 163

¥

RMB / JPY

& yen

& # 165

Euro

& euro

& # 8364

§

Subsection

& sect

& # 167

©

Copyright

& copy

& # 169

®

Registered trademark

& reg

& # 174

Trademark

& trade

& # 8482

×

Multiplication sign

& times

& # 215

/

Division sign

& divide

& # 247

Although html is not case-sensitive, entity characters are case-sensitive.

Powered by TorCMS (https://github.com/bukun/TorCMS).