How to add spaces in html: 1. Insert multiple spaces by entering the " " or " " code; 2. Insert spaces of different widths by " " or " " Space.
The operating environment of this article: Windows 7 system, HTML5 version, DELL G3 computer.
1. Insert a non-breaking space.
Generally speaking, no matter how many times you press the space bar, HTML will only display a blank space between words. When you need to insert multiple spaces, please enter the or code. They are called "space placeholders". If you enter a few, they will display a few spaces on the page.
The reason why it is called a non-breaking space is because it does not produce a newline character. If you abuse this spacing, the browser may not be able to insert line breaks in a neat and readable way. [2]
#2. Insert spaces of different widths.
There are various character entities that allow the browser to display spaces. Different browsers may display this a little differently, but unlike , they do not affect line breaks:
— "enspace" is named after the typographic unit of measurement, width. It is the width of two ordinary spaces
— "em space" is about the width of four ordinary spaces
[Recommended learning: HTML video tutorial】
The above is the detailed content of How to add spaces to html. For more information, please follow other related articles on the PHP Chinese website!