Home > Article > Web Front-end > What is the difference between br, p and DIV in html?
Many people don't understand. br, p and DIV are all tags. What's the difference between them? Can I use it however I want? This is not the case. Today I will tell you in detail what are the differences between the three tags br, p, and DIV
div and p are paired combination closing tags;
df250b2156c434f3390392d09b1c9563 is a single closing tag.
Start with dc6dce4a544fdca2df29d5ac0ea9906b, end with 16b28748ea4df4d9c2150843fecfba68;
Start with e388a4556c0f65e1904146cc1a846bee, end with 94b3e26ee717c64999d7867364b1b4a3
Small example:
<div>内容一</div> <div>内容二</div> <p>第一段</p> <p>第二段</p>
Different effects
div tags and p tags are used for web page layout.
div is a common layout tag, which layouts content like a span tag. Setting the CSS style of DIV can achieve the content layout effect.
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 div and p, and div can also be placed in p, and p can also be placed in div.
Small example:
<div style="color:red">我在div标签内,字体颜色为红色</div> <p>我是第一段文章内容</p> <p>我是第二段文章内容</p> <p>我是第三段文章内容<br />我被换行<br/>我也被br换行</p>
The above is the difference between the three tags br, p, and DIV. For more exciting information, please pay attention to php中文网Others related articles!
Related reading:
How to display circular images in css3
##How to make the web page black and white
The above is the detailed content of What is the difference between br, p and DIV in html?. For more information, please follow other related articles on the PHP Chinese website!