<Div> and <span> are used to specify a style for the content or bind a script. Although most HTML elements can use style attributes to set style information, many HTML elements have their own default styles, which may be mixed or even conflicted with styles defined by style, we don't want to see it. For example, <strong style = "color: Red"> I am strong! </Strong>. Unlike other HTML elements, <div> and <span> have no default display style. You can use them to specify styles.
(1) <div> (Division) is a block-level element that can contain paragraphs, titles, tables, and even chapters, summaries, and remarks. As a block-level element, a line break is inserted at the beginning and end of a paragraph. <Div align = "">... </Div> is used to set the position of the content block. You can use <div> to bind scripts or styles to any part of the document.
(2) Unlike <div>, <span> is an element in a row and does not cause line breaks. It is a logical embedded grouping element. The most common method is to use it to specify a style for several words or even a few characters in a text segment.
(3) Place the content to be centered in the middle of <center> </center>. The <center> and <Div align = "center"> Functions The Same.
Example: Use of <span> elements.
<P> in this sentence <SPAN class = "important"> some of the text is important! </Span> </P>