Replace the half-width space entered in the Rich text editor

Source: Internet
Author: User

Regular substitution (prevents the substitution of spaces in HTML elements) \s (?=[^>]*<)

HTML provides 5 types of 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.

&nbsp;

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, it is the space key to produce 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,

This space occupies a width that is strongly influenced by the font.

&ensp;  

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,

Is that it occupies a width of exactly 1/2 Chinese width, and is largely unaffected by the font.

&emsp;    

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 characteristics of the space family: transparent, this space also has a fairly robust feature,

Is that it occupies a width of exactly 1 Chinese width, and is largely unaffected by the font.

&thinsp;  

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.

Replace the half-width space entered in the Rich text editor

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.