The Basic Document

Introduction

First let us begin with two definitions:
source file
The ASCII file, created by some editing process, which uses HTML commands and text to create a document that is readable by World Wide Web browsers.
HTML document
What you see on the computer terminal after the browser reads the source code.
To create an HTML 3.2 document, you must begin the source file with the tag
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
(There are similar tags for the other versions of HTML.) The second tag is <HTML> and the file ends with the tag </HTML>. Within these HTML tags goes all of the other text you wish to put in the source file. You now divide the source file into two parts, the head and the body.

Head

The head of a document must contain a title although there are a number of other tags, used by browsers but invisible to users, that can be placed here. The source code for the head of this document looks like this:
<HEAD>
<TITLE>Document Format</TITLE>
<META NAME="robots" CONTENT="noindex, nofollow">
</HEAD>
These are the first four lines following the tag <HTML> in the source code for this document. The head begins with the tag <HEAD> and ends with the tag </HEAD>. In between these two tags is the title which is sandwiched between the tags <TITLE> and </TITLE>. The title should be short and descriptive. It is not the title that may appear in the document. That title is defined in the body of the source code. These two titles may be the same but need not be. The optional META tag is an instruction to search engine robots to ignore the page.

Body

The body consists of all of the other tags and text that make up the source file. The body begins with the tag <BODY> and ends with the tag </BODY>. In fact, the </BODY> tag is the penultimate tag in the source code with </HTML> being the last. Part of the source code for the body of this document looks like this:
<BODY>
<H1>Basic Document Format</H1>
The basic core of the HTML language ...
</BODY>
</HTML>

Complete Layout

Here is a listing of the most basic HTML tags needed to set up a document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HEAD>
<TITLE>Put a Short Title Here</TITLE>
</HEAD>
<BODY>
Put the Body of the Document Here
</BODY>
</HTML>
In the other HTML demonstration pages you look at some of the different tags that you can use in the body of the source file to create HTML documents.
[HTML Tutorial Home Page] [Next Page]
Obliquity Valid HTML 3.2! Copyright © 1995-2007 by David Harper and L.M. Stockman
All Rights Reserved
Designed and maintained by Obliquity
Last modified on 1 January 2007
https://www.obliquity.com/computer/html/basics.html