Home > Web Front-end > HTML Tutorial > How to add spaces to html

How to add spaces to html

藏色散人
Release: 2023-01-05 16:12:10
Original
23791 people have browsed it

How to add spaces in html: 1. Insert multiple spaces by entering the " " or " " code; 2. Insert spaces of different widths by " " or " " Space.

How to add spaces to html

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]

How to add spaces to html

#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

How to add spaces to html

[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!

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