Site Structure

Parent and Child Elements

With the video and unordered list elements, you may have noticed something interesting: these HTML elements had other HTML elements nested inside of them.

For example, in unordered lists, li elements are nested inside the ul.

  <li>First item</li> 
  <li>Second item</li>

Web developers refer to the enclosing element as the parent element and the enclosed elements as children.

Referring to HTML elements as parents and children may sound funny, but it's a core web development concept. The web browser also knows about these parent/child relationships, which will be important as we explore CSS in the next lesson.


In the diagram to the right, notice the following:

  1. The ul element is the parent of each li.

  2. The li elements are children of the ul.

  3. Code indentation signifies the relationship between parent and child elements.

After you have familiarized yourself with the diagram, click Next to continue the lesson.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.