2. HTML Specification
An HTML document is like a text file, except that some of the characters are markup. Markup (tags) define the structure of the document.
To identify information as HTML, each HTML document should start with the prologue:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
Example:
<H1>This is a Heading</H1>Some elements only have a start tag without an end tag. For example, to create a line break, you use the <BR> tag. Additionally, the end tags of some other elements, such as Paragraph (<P>), List Item (<LI>), Definition Term (<DT>), and Definition Description (<DD>) elements, may be omitted.
The content of an element is a sequence of characters and nested elements. Some elements, such as anchors, cannot be nested. Anchors and character highlighting may be put inside other constructs.
In a start tag, the element name must immediately follow the tag open delimiter <.
The value of the attribute may be either:
2.6.3 Attributes
In a start tag, white space and attributes are allowed between the element name and the closing delimiter. An attribute typically consists of an attribute name, an equal sign, and a value (although some attributes may be just a value). White space is allowed around the equal sign.
In this example, A is the element name, HREF is the attribute name, and http://host/dir/file.html is the attribute value:
<A HREF="http://host/dir/file.html">
To put quotes inside of quotes, you may use the character representation " as in:
<IMG SRC="image.ps" alt="First "real" example">
The length of an attribute value is limited to 1024 characters after replacing entity and numeric character references.
<UL COMPACT="compact">
can be written using a minimized syntax:
<UL COMPACT>
2.6.4 Special Characters
The characters between the tags represent text in the ISO-Latin-1 character set, which is a superset of ASCII. Because certain characters will be interpreted as markup, they should be represented by markup -- entity or numeric character references. For more information, see Section 2.16.
For example:
2.6.5 Comments
To include comments in an HTML document that will be ignored by the HTML user agent, surround them with <!-- and -->. After the comment delimiter, all text up to the next occurrence of --> is ignored. Hence comments cannot be nested. White space is allowed between the closing -- and >, but not between the opening <! and --.
<HEAD>
<TITLE>HTML Guide: Recommended Usage</TITLE>
<!-- Id: Text.html,v 1.6 1994/04/25 17:33:48 connolly Exp -->
</HEAD>
HTML 2.0 Specification (Internet Draft) - 29 NOV 94
[Next] [Previous] [Up] [Top]
Generated with CERN WebMaker