Home > Web Front-end > HTML Tutorial > 5 types of spaces in HTML

5 types of spaces in HTML

墨辰丷
Release: 2018-06-04 14:53:51
Original
1860 people have browsed it

HTML provides 5 types of space entities (space entities), which have different widths. Non-breaking spaces ( ) are the width of regular spaces and can run in all major browsers. The following article will introduce to you the meanings of the five types of spaces in HTML. Interested friends can refer to it

HTML provides five types of space entities (space entities), which have different widths. Non-breaking spaces ( ) are the width of regular spaces and work in all major browsers. Several other spaces (     ‌‍) have different widths in different browsers.

# & nbsp;

# This is called not to change the space, the full name No-Break Space, it is the most common and most used space, big Most people may only be exposed to it, which is the space generated by pressing the space key. In HTML, if you use the space bar to generate this space, the spaces will not accumulate (only count as 1). It can only be accumulated using html entity representation.

The width occupied by this space is obviously and strongly affected by the font.

 ​​​​​​​​​​​​ half of. By definition, it is equivalent to half the font size (e.g. 8px in a 16px font). Nominally the width of the lowercase letter n. This space inherits the consistent characteristics of the space family: it is transparent. This space has a very stable characteristic. means that the width it occupies is exactly 1/2 the Chinese width, and it is basically not affected by the font.

# & EMSP;

. specified number of points. For example, 1 em in a 16px font is 16px. This space also inherits the consistent characteristics of the space family: it is transparent. This space also has a very stable characteristic. means that the width it occupies is exactly 1 Chinese width, and it is basically not affected by the font.

 ​​​​​​​

It is called narrow space, and its full name is Thin Space. We might as well call it a "skinny space", which means that the space is relatively thin, has a thin body, and occupies a relatively small width. It is one-sixth of an em wide. The above are the meanings of the five spaces in HTML introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. of. I would also like to thank everyone for your support of the Script House website!

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.

Related recommendations:

About the summary and sharing of space character entities in html

What can be used to replace spaces in html_html /css_WEB-ITnose

javascript - What should I do if spaces in html affect js node operations?

The above is the detailed content of 5 types of spaces in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template