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


#1

For example:

<body>
<p>Paragraph</p>
   <div>
  </div>
</body>

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


#2

<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


#3

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