Characters and entities in XHTML

Source: Internet
Author: User

XHTML provides a special set of characters
1. These characters sometimes appear in the document, but cannot be spelled in their own style.
2. In some cases, these characters have special meanings in XHTML, such as>, <, and &.
3. In other cases, some characters do not have corresponding buttons on the keyboard, such as small circles that indicate Celsius temperature.
4. In addition, there are some non-wrap spaces. The browser recognizes them as hard spaces. The browser cannot exclude some spaces like processing other spaces.
These special characters are called entities, which are the names of them by the browser. The entity in the document can be replaced by the corresponding characters in the browser.

Some common character entities are listed below:
Character entity meaning
& Amp; and Mark
<& Lt; Yu no.
> & Gt; greater
"& Quot; double quotation marks
'& Apos; or & #39; single quotes
1/4 & frac14; 1/4
1/2 & frac12; 1/2
3/4 & frac34; 3/4
. & Deg; degree Celsius
(Space) & nbsp; non-wrap Space

For example, if you call a JS function in the onmouseover attribute, double/single quotation marks (") and layer-3 nesting may occur. The browser may find a syntax error, therefore, the "or" in the function parameters must be replaced by the actual body (it seems that there are other methods, so this is the simplest ).

In IE, & apos; cannot replace '. It can only be replaced with & #39;. "It is no problem to replace & quot;. In Firefox, & apos; and & #39; can be correctly interpreted as single quotation marks '.

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.