is the HTML p tag a single label? How to use HTML p tags (enclosing instance)

Source: Internet
Author: User
This article mainly introduces the specific use of P tags in HTML and some of the functions, there are examples of explanations, then let's take a look at this article about the HTML p tag

First we look at the HTML p tag is a single label it?

Listen to this question know is not how to use HTML, or have not heard of the small white, because the HTML p tag is one of the most common HTML tags, paragraph tags, block-level elements, is a general introduction to P tags, <p> beginning to </p> end, in <p> All the text in the </p> tag is displayed in a text in a browser. (Want to see more on the Topic.alibabacloud.comHTML online course)

Let's look at the example and then explain:

<!doctype html>

This inside I add two paragraph words, there are two P tags, the effect of the display in the Web page

So do not say that the P label is in pairs appear, if you forget the end of the effect is also poor, the browser can be normal display, but this violates the standards of the standard, and in case you appear in the browser a bit of error, to the end you find just p tag does not end, this is much injustice ah, so, still good write P tag , don't forget to end the tag.

look again because the P tag is block-level elements , block-level elements are displayed in the Web page is a change of paragraph display, and the line is a bit worse, normal, said the line is OK, but we have to formally, the line has a newline label, its label is </BR> This is an element with no end tag. The general line is a bit more, the BR tag will appear in the back of the line, and then the text will be shown in the next line, and now we look at the example

<body><p> here is, this </br> provides a lot of free, original, high-definition video tutorials, in the learning time can be directly online combat. </p> here is the PHP Chinese network, you are welcome to come </p></body>

Add a br wrap tag in the middle, let's look at the effect below:

, I added a br tag in the middle of the "here", and we could see that there was nothing behind the BR, and the line was empty. So the usual time, a paragraph has a lot of text, often need to put some text focus, in addition to bold and italic, we can also try to line, so that the text is highlighted, in a row in a few words can not stand out.

Summary of HTML P tags:

P tags are mainly used in <body> tags, like news page, full of paragraphs, that here will use a lot of P tags, p tags can also add a lot of elements, in here do not say, the result is the P tag is an indispensable element of HTML page, usage is very large, But the specific need for other labels to assist the label's aesthetics and overall.

OK, the above is the whole content of this article, what questions can be asked 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: 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.