HTML entity characters

Source: Internet
Author: User

In HTML, when certain characters are reserved, such as less than (<), greater than (>), the browser considers them to be labels, and some characters cannot be entered with the keyboard. If you need to display them correctly, you need to use character entities in the HTML source.

Character entities have two representations of entity name and entity number:

&entity_name; Entity Name

&entity_number; Entity numbers

If less than the number, can be written as &lt; & #60;. Note: 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).

A nonbreaking space (&nbsp;) is a commonly used character entity in HTML, and usually the browser will always truncate the space in the HTML page, leaving only one. To display multiple spaces in a page, you need to use the &nbsp; character entity.

In PHP, the function htmlspecialchars () function converts some pre-defined characters to HTML entities.

Attached: Useful character entities in HTML http://www.w3school.com.cn/tags/html_ref_entities.html

HTML entity characters

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.