Home  >  Article  >  Web Front-end  >  What is the difference between div, br and p in html?

What is the difference between div, br and p in html?

云罗郡主
云罗郡主forward
2018-10-11 09:39:243460browse


The content of this article is about the difference between div br p in HTML. It has certain reference value. Friends in need can refer to it. I hope it will help You helped.

1. Different syntax

p and p are paired closing tags;
is a single closing tag. Start with

and end with

; start with

and end with

Small example:

<p>内容一</p> <p>内容二</p> <p>第一段</p> <p>第二段</p>

Effect screenshot:

What is the difference between div, br and p in html?

2. Different effects

p tag and p tag are used for web page layout.
p is a common layout tag, which layouts content like a span tag. Setting the CSS style of p can achieve the content layout effect. The
p tag is a paragraph tag, usually used for article segmentation. The

br tag is used for content line breaks. For example, the function of text wrapping and typesetting.

br can be placed in p and p. At the same time, p can also be placed in p, and p can also be placed in p.

Small example:

<p style="color:red">我在p标签内,字体颜色为红色</p> <p>我是第一段文章内容</p> <p>我是第二段文章内容</p> <p>我是第三段文章内容<br />我被换行<br/>我也被br换行</p>

Effect screenshot:

What is the difference between div, br and p in html?

The above is the complete introduction, if you want To learn more about HTML video tutorial, please pay attention to the PHP Chinese website.

The above is the detailed content of What is the difference between div, br and p in html?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:divcss5.com. If there is any infringement, please contact admin@php.cn delete