Basic Document Structure

Tags Explained

The Important Document Tags

The HTML Tag
The HEAD and BODY Tags
A Brief Example
The TITLE Tag
The ADDRESS Tag
A Final Example

Back to the index

Tags Explained

HTML, HyperText Markup Language, is a language mainly concerned with formatting. It allows for controlling the placement and structure of text and images through the use of "tags." The tags used in an HTML document can be seen by selecting "View Source" from the View pulldown menu at the top of the screen, and are easily identifiable as they have the following form:
<Some string>
Some tags act in pairs -- like parentheses. These pairs will format the text or image they enclose. The opening tag looks like the example above, and the closing tag has a / before the string. Here is an example of such a tag pair:
<HTML> text... text... image... text... </HTML>
HTML pretty much ignores empty spaces and blank lines between tags, even paired tags. So it would be equally acceptbale to structure your document like this:
<HTML> text... text... image... text...
</HTML>
... or like this:
<HTML>
text... text... image... text...
</HTML>
Back to the top

The Important Document Tags

Every HTML document should have a few standard tags. Some are optional, but it's always a good idea to include them.


The HTML Tag

The very first thing that should go in an HTML document is the <HTML> tag. This lets the browser know that what it is displaying is an HTML document so it can interprete the tags. The <HTML> tag is a paired tag, so a </HTML> tag should be the last thing in the document, enclosing the HTML text.

Back to the top


The HEAD and BODY Tags

Within the <HTML> ... </HTML> tags, the document should be divided into a HEAD and BODY. This is done by using the paired <HEAD> ... </HEAD> and <BODY> ... </BODY> tags. The HEAD of the document is used for storing such information as the document's title, while the BODY stores the main "body" of the text.
Back to the top


A Brief Example

What we have so far should look like this:
<HTML>

<HEAD>
. . . . . .
</HEAD>
<BODY>
. . . . . .
</BODY>

</HTML>
Back to the top


The TITLE Tag

Every document needs a title. The title won't show up on the page itself, but up at the top of the application window. The title of this document, for example, is "Basic Document Structure." It is important to choose a descriptive title for your documents... the title is also how the page is identified from within the Bookmarks list.

The title tag is another paired tag, and it should be nested inside the HEAD and /HEAD tags like this:

<HEAD>
<TITLE>My Document Title Here</TITLE>
</HEAD>
Back to the top


The ADDRESS Tag

The ADDRESS tag is completely optional, but it is considered in good form to always include it at the end of your documents. This paired tag italicizes whatever it encloses, and is generally used to display the last time the document was updated and address of the document's author. An example of the use of the <ADDRESS> ... </ADDRESS> tags can be found at the bottom of this page.

One thing to note in dating your document's last update: many countries don't follow the mm/dd/yy structure for dating that we use here, but instead use dd/mm/yy, so it's good to make your meaning explict.

Back to the top


A Final Example

The set of standard tags in a document should look like this:
<HTML>

<HEAD>
<TITLE>My Document Title Here</TITLE>
</HEAD>

<BODY>
The text of the document
and any images you want
included go here.
<ADDRESS>Last updated 14 jan 95 by me</ADDRESS>
</BODY>

</HTML>
Back to the top


Back to the index

Last updated 27 june 95 by katie