in HTML     The difference between 6 kinds of blank spaces such as  

Source: Internet
Author: User
I believe a lot of students HTMLThe space in accordance with the understanding is not too deep, this thought HTMLThe space in the only one, and after looking at the original HTMLThere are six kinds of space in accordance with it! No more nonsense, let's take a look.

HTML provides 5 space entities, which have different widths, non-breaking spaces ( ) are the width of regular spaces and can run on all major browsers. Several other spaces (      ‌‍) vary in width across browsers.

 

It is called no newline space, the full name of No-break space, it is the most common and we use the most space, most people may only touch the great, it is the space key generated by the spaces. In HTML, if you use the SPACEBAR to generate this space, the space will not accumulate (only 1). To use an HTML entity representation to accumulate, the space occupies a width that is significantly and strongly affected by the font.

 

It is called "half-width space", the full name is en space,en is the unit of measurement of typography, half of the em width. By definition, it is equal to half the font size (8px in 16px fonts, for example). Nominally the width of the lowercase letter N. This space inherits the character of the space family: transparent, this space has a fairly robust feature, that is, it occupies a width of exactly 1/2 Chinese width, and basically unaffected by the font.

 

It is called "full-width space", the name is EM Space,em is the unit of measurement of typography, equivalent to the current specified number of points. For example, 1 em is 16px in a 16px font. This space also inherits the character of the space family: transparent, this space also has a fairly robust feature, that is, it occupies a width of exactly 1 Chinese width, and basically unaffected by the font.

 

It is called a narrow space, the full name is thin space. We may call it "thin space", that is, the space is relatively thin, thin body, occupy a relatively small width. It is the one-sixth width of em.

‌

It is called 0 wide non-ligature, the full name is zero width Non Joiner, referred to as "Zwnj", is a non-printing character, placed in the electronic text between two characters, suppress the original hyphenation will occur, but the two characters of the original glyph to draw. The 0-wide hyphenation character in Unicode is mapped to "" (zero width non-joiner,u+200c), and the HTML character value is referred to as: & #8204;

‍

It is called 0 wide ligatures, the full name is zero width Joiner, referred to as "ZWJ", is a non-printing character, placed in some of the complex typesetting language (such as Arabic, Hindi) between two characters, so that these two will not occur hyphenation characters produced hyphenation effect. The Unicode code bit for the 0 wide hyphen is u+200d (HTML: & #8205; ‍).

In addition, the browser will parse the following characters as blanks: spaces (& #x0020;), Tab stops (& #x0009;), line feeds (& #x000A;) and carriage returns (& #x000D;) and (& #12288;) and so on.

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.