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;
is a single closing tag.
Start with
Start with
, end with
Small example:
内容一内容二第一段
第二段
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标签内,字体颜色为红色我是第一段文章内容
我是第二段文章内容
我是第三段文章内容
我被换行
我也被br换行
The above is the difference between the three tags br, p, and DIV. For more exciting information, please pay attention tophp中文网Othersrelated 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!