Easy-to-mix HTML Entities and correct use

Source: Internet
Author: User

Easy-to-mix HTML Entities and correct use

On the page, there are multiple methods to indicate HTML entities, such as "& + name; "," & # + 10 hexadecimal ID ", and" & # x + 16 hexadecimal ID ". "\ U + hexadecimal" is generally used for the content style attribute of CSS.

Null Character-null

NULL Character: \ u0000

Blank-whitespace

Empty characters indicate no characters, which do not occupy the physical location of the page. blank spaces are physically located. Blank spaces include spaces, tabs, carriage returns, and line breaks.

Space-space:, \ u0020;

Uninterrupted space: Or \ u00A0;

Tab: Or \ u0009;

Press ENTER-CR: Or \ u000D;

Line Break-LF: Or \ u000A;

The difference between a non-stop space and a space is that when multiple spaces are merged, the latter will collapse into a space, and the non-stop space will not collapse no matter how many. In the HTML page, the element line feed is not through CR or LF, but through
Label. CR and LF are mainly used in
Tag. Display of spaces, tabs, carriage returns, and line breaksWhite-spaceStyle impact.
Single quotation marks and double quotation marks

The reference symbols for different languages are different (https://en.wikipedia.org/wiki/Quotation_mark), if you enter directly on the page, it requires a lot of pages, and too cumbersome, usually through the CSS attribute quotes, you can also set the content together with before and after.

/* Set two levels of quotation marks */

Q {quotes :"? ""? ""? ""? ";}

Q: before {content: open-quote}

Q: after {content: close-quote}

If you combine the: lang selector, you can modify the quotation marks for any localization.

Single quotation marks (')

IE8 does not support ', so' or \ u0027 is generally used.

Double quotation marks (")

"Or" or \ u0022

Chinese single quotes left (')

\ U2018, 'or'

Chinese single quotes right (')

\ U2019, 'or'

Double quotation marks left (")

\ U201C, "or"

Double quotation marks (")

\ U201D, "or"

The reason for the large-scale use of (') and (") is that the previous typewriter and the computer did not have the corresponding symmetric reference symbol, so they all used vertical symbols. Currently, some software can directly change the vertical character to a symmetric reference character. However, this automatic conversion is not perfect. Therefore, as the client's Character Set becomes richer and richer, we should also use these characters correctly.

Hyphens (-), hyphens (-), breaks (-), and underscores (_)

The differences between the following characters are very small and need to be observed carefully. From the Length Analysis: mdash> ndash = minus signs> hyphen = hyphen-minus; from the position height analysis: ndash = mdash = hyphen> minus = hyphen-minus> underline.

Hyphen-minus (-):-or \ u002D

Underline (_): _ or \ u005F

Minus (?) : −Or \ u2212

Hyphen (-):-or \ u2010

Ndash (-):-or \ u2013

Mdash (-):-or \ u2014

Hyphen-minus is the symbol used for code writing. It is the lowercase symbol on the keyboard. on the keyboard, hyphen-minus is an underline, which can be obtained through the shift key; the minus sign is generally used in mathematical expressions. A hyphen, as its name implies, is a link to two words to form a new word, such as left-handed. Ndash is used to indicate the range, such as 2-9. Mdash is used to link sentences, such as Star Wars is-as everyone knows-amazing. Omitted character

Some people will use three periods to indicate, in fact, this is an incorrect representation method, should be omitted.

Omitted character :... Or... Or... Or \ u2026

Yu and Yu

Because HTML tags use these two symbols, if you enter a greater than or less than a number on the page, the page displays an exception. Generally, only beginners will misuse these two symbols.

Minor signs: <or \ u003C

Greater than:> or \ u003E.

And symbols, or symbols

What is easy to misuse is the & Symbol. Direct use on the English page may cause a problem in Word display. Because "& + name;" indicates another special character. If ";" is located in front of the word and is followed by ";", it is terrible. Therefore, it is generally replaced.

And Symbol: & or \ u0026

Related Article

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.