Can html p tag contain a tag? Description of the role of html p tag

寻∝梦
Release: 2018-08-29 13:38:55
Original
16044 people have browsed it

This article mainly introduces the function of the HTML p tag. The

tag can contain the explanation of thetag. It also mainly explains the function of the HTML p tag. Now Let's take a look at this article

First of all, let's talk about whether the a tag can be included in the p tag?

Let’s first look at the

tag, which is a block-level element. It occupies an exclusive line and its width automatically fills the width of its parent element.

The tag is an inline element. It will not occupy a single line. Adjacent inline elements will be arranged in the same line. The line will not be broken until it cannot fit in one line. Its width changes with the content of the element.

Block-level elements can contain inline elements. , so thetag can be included in the

tag.

Here is an example where the

tag contains thetag:

    我是网页标题(我是PHP中文网) 
  

这里是PHP中文网点击这里进入这也是PHP中文网,点击中间的字

Copy after login

Here is the effect and the picture:

Can html p tag contain a tag? Description of the role of html p tag

The picture above is the picture that comes out of the code. The purple underlined one is the a tag of the hyperlink.

Now let’s talk about the role of the HTML p tag:

First of all, the

tag defines the paragraph.

The p element will automatically create some white space before and after it. The browser adds these spaces automatically, or you can specify them in your stylesheet.

Page tag usage:

You can specify paragraphs only within a block, or you can combine paragraphs with other paragraphs, lists, forms, and predefined formats used together with the text. In general, this means that paragraphs can appear anywhere there is appropriate text flow, such as in the body of the document, within list elements, etc.

From a technical point of view, paragraphs cannot appear in headers, anchors, or other places that strictly require content to be text only. In fact, most browsers ignore this restriction and format paragraphs as part of the content of the containing element.

In general, the

tag defines segments. There can be many paragraphs within a

tag.

There are also examples. This is an article I found on the Internet. I displayed it in sections:

    我是网页标题(我是PHP中文网) 
  

这里是PHP中文网点击这里进入这也是PHP中文网,点击中间的字

推进“一带一路”建设的5年,是成果丰硕的5年。习近平总书记指出,5年来的“一带一路”建设,推动我国形成陆海内外联动、东西双向互济的开放新格局。

黑龙江黑河边境经济合作区管委会主任 王海东:习近平总书记提出“政治互信、经济互融、人文互通”,本着这个原则,黑河利用独特的区域优势,从过去的一个边境走向了“一带一路”的前沿。

从落地生根到持久发展,习总书记在讲话中要求各地区加强与国家战略对接,这为各地更好对接“一带一路”建设指明了方向。

Copy after login

You can see the effect:

Can html p tag contain a tag? Description of the role of html p tagYou see, this is the role of the paragraph

tag, the content inside is the content of a paragraph.

Okay, the above is the entire content of our article. If you have any questions, you can ask below

[Editor’s recommendation]

How to add html The text in the pre tag is wrapped? Usage examples of html pre tag

What does the HTML ul tag mean? Detailed explanation of the role of HTML ul tag

The above is the detailed content of Can html p tag contain a tag? Description of the role of html p tag. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!