When I insert a div
into a p
element, the DOM will correct that to
<p></p>
<div></div>
Same for a figure
element. It can't be a child of p
. So called flow elements are only allowed into parents that allow flow elements.
How do I check with JavaScript if a node is a flow element, or an element that allows flow elements as children?
Update
This has nothing to do with CSS. This is not about style, it's about the DOM.
A div
can have a div
as a child, but a p
cannot have a p
as a child.