EXPLORING THE INTERNET - Class #19 - Class #22

The Basic Structure of a HTML Document

The Hyper Text Markup Language (HTML) document is a collection of text, data, and tags. The tags which tell the browser how to:

The Tag

The Tag is made up of < Command > i.e. an open < and a close > angle bracket and a reserved word.

The Tags normally come in pairs -- an open tag <Command> and a stop tag </Command>. The text in between the start and stop tag is rendered or displayed according to the computers capability as required by the command in the tag.

For instance, the title tag comes in a start and stop pair and in the following example:

<TITLE>Sample Text</TITLE>

Will result in the words Sample Text appearing in the window bar of the browser that displays the HTML document.

The paragraph tag <P> originally was one of a limited number of tags the did not come in pairs. The latest versions of HTML now also recognizes a paragraph pair <P> and </P> eventually, this will be the common case.

Tag commands are case insensitive i.e. the browser will recognize <TITLE> or <Title> or even <title> as a valid title tag.

Failure to correctly pair the tags; for instance forgetting the "/" in the stop tag can lead to some strange results. Also, the overlapping of tags can lead to some browsers failing to produce the intended output. It should be remembered that not everyone is using the same browser. The tag gives the browser a directive and the browser interprets it as best it can and still conform to the standard.

The HTML Document Structure

The HTML document starts and ends with a <HTML> and a </HTML> pair and should have two basic parts:
  1. the Head
  2. the Body

The Head

The Head contains information that give the document's creator a means of titling it, pointing to the original source if copied, comments, etc. The Head is not normally displayed but is extremely helpful to both the developer, the knowledgeable reader who can use the browser to read the HTML source, and finally, to the browser. The Head is set off by a <Head> and </Head> pair and must contain a <Title> inside it. The Title is always required,. The Head can sometimes be inferred by the browser but this may lead to unhappy results in the future.

The Body

The Body section of the document is the portion of the document that is displayed.

The Basic Structure

Thus the Basic HTML document structure looks like:
<HTML>
<HEAD>
<TITLE>Your Title Here</TITLE>
</HEAD>
<BODY>
                      ← Your document information goes here.

</BODY>
</HTML>

Many HTML Editors use the some form of the above structure as the starting template. From there, you add/modify as necessary to create your document.