HTML 101

Steve Spence
Updated: 12 September 2016

The basic structure of HTML

Nesting Russian dolls

<html>

<head>

</head>

<body>

<p>some text</p>

</body>

</html>

 

Most HTML tags come in two pieces: an "open" piece (ex. <p>) and a "close" piece (ex. </p>). These two pieces function like containers. Anything in between the "open" and "close" parts of the tag is considered to be inside the tag.

The basic structure of HTML, continued

Nesting Russian dolls

<html>

<head>

</head>

<body>

<p>some text</p>

</body>

</html>

 

As a result, HTML documents (also known as web pages) are structured a lot like Russian dolls. Tags generally are nested within other tags. In the code above, for example, some text is inside the p tag, which is inside the body tag, which is inside the html tag.