Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Naming schemes on Up: The Hypertext Markup Previous: Getting started quickly


Structure of documents

The simple HTML document introduced in the previous section omits a number of HTML tags. If the document was prepared with an authoring tool, the missing tags would probably be supplied automatically and the source would appear as follows:

    <!DOCTYPE HTML PUBLIC '-//W3O//DTD WWW HTML 2.0//EN'>
    <HTML>
      <HEAD>
        <TITLE>An English country garden</TITLE>
      </HEAD>
      <BODY>
        <H1>An English country garden</H1>

<P> The garden at Hidcote Manor could be said to combine the maximum formality of design with the minimum formality of planting. It is devised as an interconnected series of outdoor rooms, enclosed by walls or hedges, each with a distinct theme, and each affording a tantalizing glimpse of the next, just sufficient to lead you on to explore further.

<P> In places the garden opens out to frame a far-reaching view of the surrounding Cotswold hills. Elsewhere the atmosphere is intimate, as in the cottage garden where four rather dumpy topiary birds, cut from box plants, face each other in a cosy circle. </BODY> </HTML>

The first line is a DOCTYPE directive and says that this document uses version 2.0 HTML. If this line is omitted, version 2.0 HTML is assumed. The rest of the document is enclosed in an HTML container element (see below); again, this is assumed if it is omitted and is therefore not strictly necessary. Most existing browsers allow you to omit these lines. They are shown here for the sake of completeness.

HTML (and SGML) regard a document as a logical hierarchy of elements. Hence, elements are the structural components of a document. Elements start with a tag identifying their type. An element can be a single entity, such as an included image or a special character. These do not require an end tag. Alternatively an element might be a chunk of data or text, which logically requires a terminating tag, in which case the element is referred to as a container.

End tags may be omitted if the end tag can be implied by what follows. For example, </P> tags need not occur in a document since they are implied by a <P> tag or in fact by any text; similarly the first <P> tag after a heading can be implied by the presence of text. This means that existing documents will conform to HTML version 2.0 with regard to paragraph marks, even if, looking at the raw HTML, the paragraph tags seem to be strangely placed (often at the end of the last line of the preceding paragraph from the viewpoint of an HTML version 2.0 browser). Originally <P> tags were paragraph separators and terminated a paragraph. They are now being redefined to start paragraphs. This is being done so that attribute information for a paragraph, such as the type of justification, can be included in the leading paragraph tag. This is also how SGML does things, and efforts are under way to make HTML more compatible with SGML.

Some start tags may contain attributes, which further define the characteristics of the element. Most attributes are specific to each element type and are described with their related elements below. Attributes usually consist of an attribute name followed by an equals sign and a value. The value may be a string literal enclosed in either single or double quotes or it may be a name token. It is best always to put quote characters around attribute values in a tag.


next up previous contents index
Next: Naming schemes on Up: The Hypertext Markup Previous: Getting started quickly

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd