×

Hierarchical Tree [1/18]

Any HTML document is an hierarchical tree. It means that each element has at most one parent, i.e., the element nesting it. Only the root element has no parent. Let's take a simple page:

<html>
  <head></head>
  <body>
    <p>Document text</p>
    <p class="text">Highlighted <span>line</span></p>
    </body>
</html>

You can draw the following hierarchical tree for this page:

It outlines the structure of nesting of elements. This example shows that span element's parent is p.text, while p.text has body as a parent.

The document's hierarchical structure defines the basics of property inheritance in it .


Do it
HTML
<!DOCTYPE html> <!-- Add some text inside the tags to see how it would look in the browser -->
CSS
HTML Academy
  1. Write the HTML code for the following tree:

    To open the image in full size, click on it.

Theory Check Next