HTML Basics
Stanford University Libraries & Academic Information Resources

The Big Structure

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]

Every HTML document consists of a single <html> element which is in turn composed of two parts, a <head> and a <body>. Thus we can start any document by putting up a skeleton (I'm going to use some indentation here to help you see keep the document structure clearly but it isn't necessary normally):

  <html>
    <head>
    </head>
    <body>
    </body>
  </html>

The Head

The Title

A good start, but not yet a legal HTML document. Something required is missing: every document must have in its <head>, one (and only one) title element.

  <html>
    <head>
      <title>The Invasion of the Giant Spore</title>
    </head>
    <body>
    </body>
  </html>

Comments

We now have a perfectly legal and complete HTML document, even if it is a bit spare. Before moving on to the next bit of work, let's leave ourselves a reminder of what we have left to do. We can do this by using a comment. Comments look like

    <!-- This -->

and can span multiple lines.

  <html>
    <head>
      <title>The Invasion of the Giant Spore</title>
    </head>
    <body>
      <!--
          The body of this document consists of sections,
          paragraphs, and lists
      -->
    </body>
  </html>

 [Previous Page]  [Tutorial Top]  [Tech Guide]  [Next Page]


Walter Henry
Stanford University Libraries and Academic Information Resources