Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to insert spaces in HTML

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to insert spaces in HTML". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Type in a space

In the html page, we can insert spaces by typing the "space" key.

Example: type one space in p.p1 and five spaces in p.p2. Note: this is a half-corner state. Type "space".

one

two

Test text | php Chinese website!

Test text | php Chinese website!

Effect picture:

As you can see, whether we type 1 or 5 spaces in HTML, or multiple other spaces, the Web browser automatically collapses these spaces to a single space.

So how do we display multiple typed spaces? You can type the "space" key in full-width state, for example:

one

two

Test text | php Chinese website!

Test text | php Chinese website!

Effect picture:

Description: full-width spaces will be interpreted as Chinese characters, displayed in the form of blank Chinese characters, and real numbers will be displayed (as many as there are).

Or use tags to solve this problem (type "space" in half-width state), for example:

one

two

three

four

five

six

Test text | php Chinese website!

Test text | php Chinese website!

Effect picture:

Use the space character of html

We can use the character entities that represent spaces in html to insert spaces in html pages. Let's take a look at the character entities that represent spaces in html:

Character: a blank space in continuous lines, the width of which is affected by the font.

  character: type half a "space" key (the width of half a Chinese character) in a full-width state.

  character: type the "space" key (the width of 1 Chinese character) in the equivalent full-width state.

Let's see the effect:

one

two

three

Test text | character nbsp displays spaces!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report