IT Band of Brothers HTML5 tutorial "meaningless" HTML element div and span

5f16a58a57bc47108e1c532aebeafd05.jpg

HTML means just giving content, most of the HTML tag has a meaning (for example, a label to create a link, h1 tags to create titles, etc.), however, span and div tag does not seem to sense any content, sounds like a bubble do as useless as a hammer. But in fact, after combined with CSS, they are widely used. Keep in mind that, div and span are "meaningless" label, they exist purely to apply CSS styles, so when style sheets fail, they will not have any effect.

 

They are used in combination as a chunk of HTML and give certain information, with most of the class attribute identifies the class and the attribute linked with an element id. Except that the span and div, span inline (inner line flag), associated with the HTML in a small block; and div (Division) is a block-level element (simply, which is equivalent to its longitudinal line-break), for a combination of large blocks of code, and provides the background for the element structure within the bulk of the contents of an HTML document may contain paragraphs, headings, tables, even when the rest, which makes div for marking different classes.

image/20191202/763c8f583184de7509d79e6a929621f3.png

 

Everything between the start tag and the end tag of div constituting the block are used, the characteristics of the elements contained therein is controlled by the attribute div tag, or be controlled by the use of style sheets to format the block.

Guess you like

Origin www.cnblogs.com/itxdl/p/12008966.html