The difference between spaces such as &emsp in HTML

HTML provides 5 space entities with different widths. Non-breaking space ( ) is the width of regular space and works in all major browsers. Several other spaces (       ‌‍) vary in width across browsers.

  •  

It is called No-Break Space, the full name of No-Break Space, it is the most common and we use the most space, most people may only come into contact with , it is the space generated by pressing the space key. In HTML, if you use the space bar to generate this space, the space is not cumulative (only 1). It can only be accumulated using html entity representation, and the width of the space is obviously and strongly affected by the font.

It is called "half-width space", the full name is En Space, en is the unit of measurement in typography, and it is half the width of em. By definition, it is equivalent to half the font size (e.g. 8px in a 16px font). Nominally the width of the lowercase n. This space inherits the consistent characteristics of the space family: transparent, this space has a fairly robust feature, that is, the width it occupies is exactly 1/2 the width of Chinese, and it is basically not affected by the font.

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

It is called a narrow space, the full name is Thin Space. We might as well call it a "thin space", that is, the space is relatively thin, thin, and occupies a relatively small width. It is one sixth of an em wide.

It is called zero-width non-ligature, the full name is Zero Width Non Joiner, referred to as "ZWNJ", is a non-printable character, placed between two characters in the electronic text, to suppress the ligature that would have occurred, but to use these two characters. to draw the original glyphs of the characters. The zero-width non-joiner character in Unicode is mapped to "" (zero width non-joiner, U+200C), and the HTML character value reference is: ‌

It is called zero-width ligature, the full name is Zero Width Joiner, referred to as "ZWJ", is a non-printable character, placed between two characters that require complex typesetting languages ​​(such as Arabic, Hindi), making this Two characters that would not otherwise be ligatured create a ligature effect. The Unicode code point for the zero-width hyphen is U+200D (HTML: ‍ ‍).

In addition, browsers interpret the following characters as whitespace: space ( ), tab stop ( ), line feed ( ), and carriage return ( ) and There are ( ) and so on.

Reprint and indicate the source: http://www.oicqzone.com/pc/2015083122336.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326440219&siteId=291194637