Basic Structure of an HTML Document
The Basic Two-Part Structure
HTML style guides recommend that each HTML document be structured in two
parts: a head and a body. The HTML tags look like this:
<head>
</head>
<body>
</body>
The content of your page goes into the body. The head is primarily for
the title of your document.
Notice that these tags (like most tags) are arranged in pairs: an opening
tag and a closing tag. The opening and closing tags enclose text (or
pictures). The closing tag is identical to the opening tag except that it
has a forward slash before the main word of the tag.
Let's add a title and some content.
Filling in the Basic Structure
The following is the recommended basic structure of an HTML
document.
<head>
<title>Your Title</title>
</head>
<body>
<h1>Your Title Again as Main Heading</h1>
Here's where the content of your page goes.
<p>
<hr>
Last Modified February 14, 1995 <br>
<address>Jay Treat security@isc.upenn.edu</address>
</body>
Notice:
- The page you are currently reading follows this same basic structure.
- The title appears in the title bar in browsers like Mosaic and
Netscape. The title of this page is "Basic Structure".
- The main heading is heading 1. The tag is <h1>. The main
heading usually repeats or amplifies the title. The main heading of this
page is "Basic Structure of an HTML Document".
- The HTML Style Guide recommends that every page record the date of
its last modification and the address of the person responsible for it
(to whom corrections and questions may be addressed).
I like to use a horizontal rule to separate these items from the main
content.
- The following three tags do not need a closing tag, since they do not
extend over any text.
- The <p> tag creates a new paragraph. It causes a line break
followed by a blank line.
- The <br> tag causes a linebreak.
- The <hr> creates a horizontal rule.
- Using combinations of headings, text, and paragraph tags, you can now
create pages of any size.
Return to home page workshop
Last Modified: November 6, 1997
If you have suggestions for this web, please forward them to
Jay C. Treat.