Complaints about js block elements and inline Elements
Someone asked this question: why can't div be placed in the p tag?
It can only be said that this is a rule, haha
Enter the topic below
Block-level elements--- H1, h2, h3, h4, h5, h6, hr, div, fieldset, form, dl, address, ol, p, table, ul, pre, etc.
Inline Element--- A, B, br, em, I, img, input, strong, textarea, span, label, and other common
What is the difference?
Block-level elements are generally used to build the website architecture, layout, and content-bearing inline elements. They are generally used in some details or parts of the website content, it is used to "emphasize, differentiate styles, superscripts, subscript, and anchor" and so on. They can be converted to each other. Display: inline | features of block-level elements: each block-level element is displayed from a new line, and the subsequent element must start with another line.
In other words, any visible element that is not a block element is an inline element.
Key: Nested rules
A block-level element can contain inline elements or some block-level elements, but an inline element cannot contain block-level elements. It can only contain other inline elements. Block-level elements cannot be placed in p. Several special block-level elements can only contain inline elements, but cannot contain block-level elements. For example, h1, h2, h3, h4, h5, h6, p, and dtli can contain div block-level elements and block-level elements, and inline elements. (Incorrect :)
??