1024programmer HTML5 5 ways to express HTML spaces that you must not know

5 ways to express HTML spaces that you must not know

HTML provides 5 kinds of space entities (space entity), they have different widths, non-breaking spaces are the width of regular spaces, and can run on all major browsers. Several other types of spaces have different widths in different browsers.

 

It is called No-Break Space, the full name is No-Break Space, it is the most common and we use the most space, large Most people may only touch it, it is the space generated by pressing the space key. In HTML, if you use the space bar to generate this space, the space will not be accumulated (only counted as 1). It can only be accumulated if it is represented by html entities.

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 measurement unit of typography , which is half the width of an em. By definition, it is equal to half the font size (e.g. 8px in a 16px font). Nominally the width of a lowercase n. This space inherits the consistent characteristics of the space family: transparent, this space has a very robust feature,

The width it occupies is exactly 1/2 the width of Chinese, and it is basically not affected Font influence.

It is called “full-width space”, the full name is Em Space, em is the measurement unit of typography , 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 very robust feature,

That is, the width it occupies is exactly 1 Chinese width, and it is basically not affected by the font Influence.

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

Thank you for reading, I hope you will benefit a lot.

Recommended tutorial: “HTML Tutorial”

The above are the detailed content of 5 HTML space representation methods that you must not know. For more information, please pay attention to other related articles on 1024programmer.com!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/5-ways-to-express-html-spaces-that-you-must-not-know-2/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索