HyperText Mark-up Language Quick Reference December 1994 This is yet another HTML quick reference, containing advice on how to write correct HTML, as well as practical tips. It is mainly based on version 1.22 of the HTML 2.0 standard (including some HTML3 extensions which are already implemented by a number of browsers; the extensions are all clearly labeled as such). Some material is from another quick reference by Tom Fine. This is not necessarily a good guide for absolute beginners. General: The HTML language represents hypertext data, for use as part of the World-wide Web. HTML is one specific language defined using the general SGML meta-language. HTTP is a transport protocol, used to deliver HTML documents (as well as other types of files) over networks. Syntax: contained stuff A "tag" is everything between the `<' and `>' characters. The tag name should come directly after the `<' character, with no intervening whitespace. Tag names and tag attributes are case-insensitive, as are the values of certain tag attributes as well. If an attribute value contains whitespace, or any characters other than a-z, A-Z, `.' or `-' it should be quoted. For this reason, most URL's should be quoted (the fact that some implementations may tamper with the alphabetic case of unquoted attribute values means that it is good style to quote all URL's). Some attributes (such as COMPACT) do not need a value. An "element" is made up of the opening tag, its matching closing tag, and everything that contained between the two (which can include other tags, and also text which is not part of any tag): Stuff In Element. The closing tags for some elements are optional (as noted below), and some tags can _not_ have a corresponding closing tag (namely,
,
, , , the non- tags in <HEAD>...</HEAD>, and the SGML pseudo-tags <!DOCTYPE> and <!-- -->). Details of text formatting in the HTML source (such as the position of linebreaks) are not preserved when the document is displayed, and extra whitespace is ignored. Overall Document Tags: <!DOCTYPE ...> SGML declaration; if it is used, it comes first in the file. (If you don't know what this is, don't worry about it.) <HTML> ... </HTML> Encloses the entire document (except <!DOCTYPE>) and identifies it as HTML. The optional VERSION attribute specifies the HTML version used. <HEAD> ... </HEAD> Encloses the header (<TITLE>, <LINK>, etc.). <BODY> ... </BODY> Encloses the body of the document. All other tags besides these, and all text which is not part of a tag, should be contained within a <HEAD>...</HEAD> or <BODY>...</BODY> element, which should be in turn contained within the overall <HTML>...</HTML>. Head Tags: <TITLE> ... The title of the document; should not contain any other tags. A title is OBLIGATORY in ...! There should be no non-tag text in ... except that which is contained in .... The title is used to index the document by Web searchers, so that it should _not_ be something which is cryptic when out of context, like "Intro". (See also

...

below.) Specifies general relationships of this document to other resources. The type of relationship is described by a REL= or REV= attribute (other attributes are URN=, TITLE=, and METHODS=). This is not generally implemented yet, except for , used to specify the e-mail address of the author. Specifies context-independent URL of current file. Next anchor name to use (for HTML editors). Provides HTTP header info (other attributes are NAME= and HTTP-EQUIV=). Document is searchable index. (This tag can also appear in ... element.) Body tags: High-level tags: ... Section headings; "n" ranges from 1 (highest-level) to 6 (least important);

-

are too small to be usable in the default configuration of some versions of NCSA Mosaic. Since the TITLE in the HEAD element is displayed on the window bar (and should be context-independent), the

...

element is generally used for the actual within-document title.
... Encloses a block of text that is a quote.
...
Information about the author and the document itself (such as copyright, sources, last update, acknowledgements, etc.). Shouldn't include lists or high-level tags (except

). Often displayed as italic.


Horizontal line (pseudo page-break).
 ... 
Encloses block of text to be shown verbatim in a fixed-width font (whitespace is significant). This is the only way to do columns or aligned tables in HTML 2.0. The WIDTH= attribute gives a display hint to browsers (the default is WIDTH=80). A
...
element cannot contain any list or high-level tags except
.

Begin a paragraph (the closing

tag is optional). Cannot contain lists, or any of the above tags. Use attributes ALIGN=CENTER or ALIGN=RIGHT to control text position (this is not yet a part of standard HTML 2.0). These high-level elements all imply both a preceding and a following paragraph break (except after the optional

tag). Lists:
  • ...
Unordered list.
  1. ...
Ordered list.
  • ...
  • Menu list (for brief items; not much used -- you can also try