HTML character entity

Source: Internet
Author: User

HTML Entities

In HTML, some characters are reserved.

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.

The character entity looks like this:

&entity_name; orentity_number;

To show the less than sign, we have to write this:&lt; or & #60;

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).

Non-breaking space (non-breaking space)

The characters commonly used character entity in HTML is a nonbreaking space (&nbsp;).

The browser will always truncate the space in the HTML page. If you write 10 spaces in the text, the browser removes 9 of them before the page is displayed. To increase the number of spaces in the page, you need to use &nbsp; The character entity.

Example HTML instance

Experiment with HTML entity symbols: Try it yourself.

Useful character entities in HTML

Note: The entity name is case sensitive!

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;

For a complete entity symbol reference, please visit our HTML entity symbol reference Manual.

HTML character entity

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.