HTML is just a means to give content. Most HTML tags have their meanings (TAG p creates a paragraph, and the h1 tag creates a title, however, the span and div labels do not seem to have any meaning in content, and it sounds as useless as a bubble-made hammer. But they are widely used when combined with CSS. They are used to combine a large piece of HTML code and give certain information. Most of them are associated with elements using class attribute class and id attribute id. For details, see class and id selector in the CSS intermediate guide.
The difference between span and p is that span is inline and used in a small inline HTML, while p (think about what pision means) elements are block-level (simply put, it is equivalent to having a broken line before and after it), used to combine a large piece of code.
This is crazy
In practice, p, especially span, should not be abused, although there are other different opinions. For example, if you want to emphasize the word "crazy" and bold class "paper", such code may be used:
This is
Crazy
This is better than adding another span.
Is there any clue about class and id? Don't worry, they will be exposed in the CSS intermediate guide. All you need to remember is that span and p are "meaningless" labels.
The above is the difference between Span and Div in the webpage _ experience exchange content. For more information, see PHP Chinese website (www.php1.cn )!