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

云罗郡主
Release: 2018-10-11 09:41:31
forward
3506 people have browsed it


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>
Copy after login

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="max-width:90%">我在p标签内,字体颜色为红色</p> <p>我是第一段文章内容</p> <p>我是第二段文章内容</p> <p>我是第三段文章内容<br />我被换行<br/>我也被br换行</p>
Copy after login

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!

Related labels:
source:divcss5.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template