How do I set a space in an HTML paragraph element? Summary of settings for HTML spaces

Source: Internet
Author: User
HTML summary of the paragraph elements want to leave some space, but the direct play space symbol is definitely not working, because the browser will only display a space, no matter how many spaces you point is the same, but today's space character   can help you these busy, and finally there are three characters in the ranking situation. Let's see this article together

First, let's take a look at how the HTML paragraph elements set spaces:

We all know that in the HTML paragraph, want to put a word between a little more distance, point a space, but in most mainstream browser all the space will only show a small space distance out, so in writing code will be the space symbol to use out, although now with less space symbol, But in some of the details of processing, want to leave some space when still use this whitespace processing is the most convenient.

Now let's take a look at the setting of whitespace in a paragraph element:

<!doctype html>

The above code left a large line behind the first sentence, and we thought that it would be greater than the distance between the spaces I used in the back.

Let's take a look at the display in the browser:

We can see very clearly, the first is to use so many spaces heap out of space, in the browser will only show a little space, followed by the effect of the space-character display is not more than their own space to play a lot better, the room suddenly much larger.

Of course, we usually do not want to empty a lot of space, even if you want to empty, it will not use spaces. Today we are talking about the use of space, not to mention the other, this space for some lazy people is still very useful. (Want to see more on the Topic.alibabacloud.comHTML Development Manual section of the study)

Let's take a look at this. There are also two space characters that are the same, let's take a look at:

&ensp; : "En space" is named according to the unit of measure of typography, width is the width of two ordinary spaces

&emsp; : "em space" is probably the width of four ordinary spaces

is a space symbol that does not affect line breaks. They are used a little less than a few, because they sometimes have empty space is relatively large.

Let's take a closer look at the difference between them:

<body><p> this is topic.alibabacloud.com;&ensp;&ensp;&ensp;. Here is topic.alibabacloud.com; this is topic.alibabacloud.com;&nbsp;&nbsp;&nbsp;. This is topic.alibabacloud.com, this is the PHP Chinese network;&emsp;&emsp;&emsp; Here is topic.alibabacloud.com; here is topic.alibabacloud.com; here is topic.alibabacloud.com; this is topic.alibabacloud.com;</p. ></body>

With three space symbols in it, let's look at the effect:

Three kinds of space tags, we look at the above display chart to rank them, of course, there are a lot of people on the Internet to this ranking, but we say their own, let oneself more clearly know on the line.

Now let's take a look at the picture above:

First place, the largest of course is the &EMSP, and it is obviously put, are three characters, &emsp; Max.

Second place, the second largest of the empty is &ENSP, and this is the second largest of the empty, nearly as big as the last one.

The last one, of course, is what we are talking about in this chapter &nbsp; spaces, although the space is small, but in some places it is very practical.

Well, today's article about the space &nbsp; is here, want to learn more about the Topic.alibabacloud.comhtml Reference Manual section to learn it. If you have questions, you can ask below.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.