Why is <p> the child of <div> even though it is not nested inside?

For example:


I thought <body> was the parent of <p>? I thought code that is nested becomes the child of the nested code?

<p> should not be a child of <div>. The parent-child structure should be:

body-parents: html
body-children: p, div
p-parents: body
p-children: "Paragraph"
div-parents: body
div-children: none

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.