<Div> <p> <span> usage and differences

 

<div> tag can document into separate, distinct parts. It can be used as a strict organizational tool , and does not use any format associated with it.

More important is the realization of a dynamic Web page, the regional division of the unified process, such as changing the background color , font and so on.

<div> is a block element. Its content automatically start a new line. In fact, the new line is the <div> performance on only format.

<br> wrap is a pure, typically can be written as a

<p> represents a paragraph , for the <p> and content between </ p>, as a unitary paragraph , also has the form wrap effect . Typically used article segments.

The selection of the three tab, you can write articles to consider the way, if you're considering the overall framework of the article, on the first <div>; write each one of the sections of each segment, it <p>; if there is a piece of content part of the content needs to start a new line (the contents of the previous line still belongs to wrap the content of paragraph), it <br>.

 

<Span> tag is a line for a combination of a plurality of elements within the row.

div and span difference

div position is occupied by his party.
How wide is the span occupied by the content on the occupation of how wide spatial distance.

<div> tag can document into separate, distinct parts. It can be used as a strict organizational tool , and does not use any format associated with it.

More important is the realization of a dynamic Web page, the regional division of the unified process, such as changing the background color , font and so on.

<div> is a block element. Its content automatically start a new line. In fact, the new line is the <div> performance on only format.

<br> wrap is a pure, typically can be written as a

<p> represents a paragraph , for the <p> and content between </ p>, as a unitary paragraph , also has the form wrap effect . Typically used article segments.

The selection of the three tab, you can write articles to consider the way, if you're considering the overall framework of the article, on the first <div>; write each one of the sections of each segment, it <p>; if there is a piece of content part of the content needs to start a new line (the contents of the previous line still belongs to wrap the content of paragraph), it <br>.

 

<Span> tag is a line for a combination of a plurality of elements within the row.

div and span difference

div position is occupied by his party.
How wide is the span occupied by the content on the occupation of how wide spatial distance.

Guess you like

Origin www.cnblogs.com/iOS-mt/p/11078646.html