1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<!-- Thanks for reading the source of this document. Hope you enjoy -->
<!-- what you find here. Please let me know if you find any errors. -->
<HEAD>
<TITLE>The structure of an HTML 3.2 document</TITLE>
<META NAME="description" CONTENT="This is a general overview of the structure of an HTML 3.2 (Wilbur) compliant document.">
<META NAME="keywords" CONTENT="html authoring, reference, wilbur, tag overview">
<META NAME="generator" CONTENT="Orb v1.3 for OS/2">
<META NAME="author" CONTENT="Arnoud Engelfriet">
<LINK REV="made" HREF="mailto:galactus@htmlhelp.com" TITLE="Wilbur feedback">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080"
ALINK="#000080">
<H2><IMG SRC="./icon/wdglogo.gif" WIDTH=250 HEIGHT=74 ALT="The Web Design Group presents:"></H2>
<H1 ALIGN=CENTER>The structure of an HTML 3.2 document</H1>
<HR WIDTH="75%" SIZE=3>
<P>
Writing a structured document does not mean that you are writing in
a straitjacket. It only means you have to lay out the document in
advance. It also means the document becomes easier to read, maintain
and extend. While this may not seem too important if you just want a
homepage, when you have a whole site to maintain, well-structured
documents make life a lot easier!
<P>
It is also important to note that HTML uses the <A HREF="../charset/index.html">ISO-8859-1 character
set</A>. Apart from the entities defined in the Wilbur draft, the characters
from this list are the only ones you should use. Other characters are
not guaranteed to show up at all in a browser, let alone show up as the
character you're hoping for.
<P>
Every HTML 3.2 compliant document should look basically as follows:<BR>
(Note: the line numbers are only here for the explanation below)
<PRE>
<A HREF="#doctype">1.</A> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<A HREF="#html">2.</A> <HTML>
<A HREF="#head">3.</A> <HEAD>
<A HREF="#title">4.</A> <TITLE>The title of the documents</TITLE>
<A HREF="#meta">5.</A> <META NAME="description" CONTENT="This is a document">
<A HREF="#link">6.</A> <LINK REV="made" HREF="mailto:galactus@htmlhelp.com">
7. </HEAD>
<A HREF="#body">8.</A> <BODY>
9. ... document body
10. </BODY>
11. </HTML>
</PRE>
<H2><A NAME="doctype">1.</A> DOCTYPE</H2>
This is a so-called DOCTYPE declaration. It is used by SGML tools to
detect what kind of document is being processed. If your document
adheres to the Wilbur standard, the above is what it should look like.
<P>
If your document is HTML 2.0 compliant, the DOCTYPE of it is
<CODE><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"></CODE>
<P>
Some HTML editors like to include an arbitrary DOCTYPE
declaration in your documents, even when it is not correct. Note
that in particular, any doctype for HTML 3.0 is not an "official"
declaration, since that proposal has been expired for a long time
now.
<H2><A NAME="html">2.</A> <A HREF="./body/html.html">HTML</A></H2>
This tag goes around the entire document. Basically, it states that
the rest is all HTML, as opposed to some other language which may
use tags within < and > brackets. In theory, it can also be
used by servers to see that the document they want to send is
actually HTML and not plain text. However, this is almost never done
(for performance reasons, usually).
<H2><A NAME="head">3.</A> <A HREF="./head/head.html">HEAD</A></H2>
The head of your document contains information about the document
itself. Nothing within the HEAD section should be displayed in
the document window. The head section must include the
TITLE of the document. It can optionally contain things like a
description, a list of keywords for search engines, and the name of the
program used to create the HTML document.
<P>
The HEAD tag is optional. If you arrange all the information about
the document at the top of the document, and all body tags below,
it is obvious for a parser where the header ends and where the
body begins.
<H2><A NAME="title">4.</A> <A HREF="./head/title.html">TITLE</A></H2>
The TITLE tag is the only required tag for the head section. It is
typically displayed in the browser's window title bar, and used in
bookmark files and search engine result listings. For the last two
situations, you should make sure the title is descriptive for the
document - "Homepage" or "Index" doesn't say much in a bookmark file.
<H2><A NAME="meta">5.</A> <A HREF="./head/meta.html">META</A></H2>
META tags provide "meta information" about the document. For example,
it can give a description of the document, indicate when the document
will have expired or what program was used to generate it. There are
many possible META constructs, so please read the <A
HREF="head/meta.html">section on meta tags</A> in the <A
HREF="overview.html">list of HTML tags</A>.
<P>
This particular META tag provides a description of the document, which
is used by search engines such as <A
HREF="http://altavista.digital.com/cgi-bin/query?pg=h&what=web#meta">Alta
Vista</A> and <A
HREF="http://guide.infoseek.com/AddUrl?pg=DCaddurl.html&sv=IS&lk=lcd">Infoseek</A>.
<H2><A NAME="link">6.</A> <A HREF="./head/link.html">LINK</A></H2>
A LINK tag provides information about the document relative to the
rest of the site. For example, you can have a LINK tag stating where
the table of contents is, what the next document is or where the
style sheet can be found.
<P>
This particular LINK tag gives the address of the document's author.
Some browsers (most notably Lynx) allow you to send a comment to this
person with one keystroke if this tag is defined.
<H2><A NAME="body">9.</A> <A HREF="./body/body.html">BODY</A></H2>
The BODY of the document contains the actual information. There may
be only one BODY statement in the document. Some editors incorrectly
insert another BODY statement for each new attribute you want to add
to the body, but this can have unexpected side-effects (such as some
of the attributes getting ignored completely).
<HR>
<P>
Designing a structured contents for your HTML document is an art in itself.
I won't go into it too deeply here. Initially, use only the six headers
to set up the structure of the document, adding lists, tables and other
block elements until the general layout of the document is finished.
Then begin filling in the blocks, marking up the text with the
appropriate text-level elements. Images are very important, but as the
<A HREF="./special/img.html">IMG</A> tag is a <EM>text</EM>-level tag, it must be contained in
a block-level tag.
<P>
Often a document will be part of a set, so it will use a common style.
This style should specify a standard structure for documents, including
navigation aids and standard images. Writing a template is then a very
handy thing. The WDG's
<A HREF="../../design/style/index.html">Style guide for online hypertext</A> discusses
this in more detail.
<P>
<HR>
<CENTER>
<P>
<B><IMG SRC="./icon/wdglogo-small.gif" WIDTH=105 HEIGHT=40 ALT="Web Design Group" ALIGN=RIGHT></B><BR>
<A HREF="./index.html" TITLE="Index for Wilbur">Wilbur index</A> ~
<A HREF="./overview.html" TITLE="Overview of HTML 3.2 tags">Tag overview</A> ~
<A HREF="mailto:galactus@htmlhelp.com" TITLE="Wilbur reference feedback">Feedback</A>
<P>
<SMALL>
Copyright © 1997 <A HREF="http://www.stack.nl/%7Egalactus/">Arnoud "Galactus" Engelfriet</A>.
</SMALL>
</CENTER>
</BODY>
</HTML>
|