HTML character entity

Source: Internet
Author: User

1. Preface:

There are usually two situations in which you need to use character entities:

    1. Reserved characters in HTML must be replaced with character entities.
    2. Some characters that are not found on the keyboard can also be replaced with character entities.

2. Character Entity instances:

The less than sign (<) and greater than sign (>) cannot be used in HTML because the browser mistakenly considers them to be labels.

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

Show Results Description Entity name Entity number
Space &nbsp; & #160;
< Less than sign &lt; & #60;
> Greater than sign &gt; & #62;
& and number &amp; & #38;
" Quotes &quot; & #34;
Apostrophe &apos; (ie not supported) & #39;
Score of &cent; & #162;
£ Pounds &pound; & #163;
¥ Yen &yen; & #165;
Euro &euro; & #8364;
§ Section &sect; & #167;
© Copyright &copy; & #169;
® Registered trademarks &reg; & #174;
Trademark &trade; & #8482;
X Multiplication sign &times; & #215;
÷ Division Sign &divide; & #247;

tip: The advantage of using entity names instead of numbers is that names are easy to remember. The downside is that the browser may not support all entity names (the support for entity numbers is good).

3. Combining phonetic symbols:

The pronunciation symbol is a "glyph" that is added to the letter.

Some diacritical marks, such as a sharp note (?) and a grave accent (?).

Diacritical marks can appear above and below letters, or within letters, or between two letters.

Diacritical marks can be used in combination with letters and numeric characters.

Here are some examples:

Phonetic notation character Construct Output Results
? A a& #768; A?
? A a& #769; A?
? A a& #770; A?
? A a& #771; A?
? O o& #768; O?
? O o& #769; O?
? O o& #770; O?
? O o& #771; O?

4. Precautions:

The entity name is case sensitive!

When you write characters, you should pay attention to the format, character and punctuation, one can not be wrong!

HTML character entity

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.