W3C

HTML 3.2 Features at a Glance

This is a brief summary of the features of HTML 3.2 and should be used together with the full descriptions of each element.

What is HTML 3.2?

HTML 3.2 is W3C's new specification for HTML, developed together with vendors including IBM, Microsoft, Netscape Communications Corporation, Novell, SoftQuad, Spyglass, and Sun Microsystems. HTML 3.2 will add widely deployed features such as tables, applets and text flow around images, while providing backwards compatibility with the existing standard HTML 2.0.

W3C continuing to work with vendors on extensions for multimedia objects, scripting, style sheets, layout, forms and math. W3C plans on incorporating this work in further versions of HTML. See The W3C Activity Statement on HTML for details.

How does HTML 3.2 relate to HTML 3.0?

HTML 3.0 was a proposal for extending HTML published in March 1995. HTML 3.0 was never widely deployed in spite of widespread media coverage.

What specifications are available for HTML 3.2?

The following draft specifications are still under revision, subject to final changes.

Document Type Definition
This defines the syntax of HTML as an SGML application
Catalog File
This can be used with SGML parsers like sgmls to bind FPIs to file names
ISOlat1.sgml
Defines character entity names for accented Latin-1 alphabetic characters
Table of Latin-1 character glyphs
This is provided to allow authors to pick a glyph and to include it in their documents as a numeric character entity, e.g. £ is the "£" sign.
Press Release
As released on May 7th, 1996

Additional materials will be provided giving greater details on each element.


The Structure of HTML documents

At the minimum, every HTML document must at least include the decriptive title element:

  <TITLE>A study of population dynamics</TITLE>

More generally, documents can start with a <!DOCTYPE> declaration followed by an HTML element containing a HEAD and then a BODY element:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  <HTML>
  <HEAD>
  <TITLE>A study of population dynamics</TITLE>
  ... other head elements
  </HEAD>
  <BODY>
  ... document body
  </BODY>
  </HTML>

In practice, these additional elements can be omitted, although the DOCTYPE declaration is recommended to distinguish HTML 3.2 documents from other versions of HTML.

The HEAD element

This contains the document head, but you can always omit both the start and end tags for HEAD. The following elements belong to the document head:

TITLE defines the document title, and is always needed.
ISINDEX for simple keyword searches, see PROMPT attribute.
BASE defines base URL for resolving relative URLs.
STYLE reserved for future use with style sheets.
SCRIPT reserved for future use with scripting languages.
META used to supply meta info as name/value pairs.
LINK used to define relationships with other documents.

TITLE, STYLE and SCRIPT are containers and requires both start and end tags. The other elements are not containers so that end tags are forbidden. Note that conforming browsers won't render the contents of STYLE and SCRIPT elements.

The BODY element

This contains the document body. Both start and end tags for BODY may be omitted. The key attributes are: BACKGROUND, BGCOLOR, TEXT, LINK, VLINK and ALINK. These can be used to set a repeating background image, plus background and foreground colors for normal text and hypertext links. Colors are given in RGB as hexadecimal numbers (e.g. "#C0FFC0") or as one of 16 widely understood color names:

   aqua, black, blue, fuchsia, gray, green, lime, maroon,
   navy, olive, purple, red, silver, teal, white, and yellow

These colors were originally picked as being the standard 16 colors supported with the Windows VGA palette.

Block and Text level elements

Most elements that can appear in the document body fall into one of two groups: block level elements which cause paragraph breaks, and text level elements which don't. Common block level elements include H1 to H6 (headers), P (paragraphs) LI (list items), and HR (horizontal rules). Common text level elements include EM, I, B and FONT (character emphasis), A (hypertext links), IMG and APPLET (embedded objects) and BR (line breaks). Note that block elements generally act as containers for text level and other block level elements (excluding headings and address elements), while text level elements can only contain other text level elements. The exact model depends on the element.

Headings

H1, H2, H3, H4, H5 and H6 are used for document headings. You always need the start and end tags. H1 elements are more important than H2 elements and so on, so that H6 elements define the least important level of headings. More important headings are generally rendered in a larger font than less important ones. Use the ALIGN attribute to set the text alignment within a heading, e.g.

  <H1 ALIGN=CENTER> ... centered heading ... </H1>

ADDRESS

The ADDRESS element is used for information about the author of the document. It requires start and end tags.

Block elements

P paragraphs
The paragraph element requires a start tag, but the end tag can always be omitted. Use the ALIGN attribute to set the text alignment within a paragraph, e.g. <P ALIGN=RIGHT>
UL unordered lists
These require start and end tags, and contain one or more LI elements representing individual list items.
OL ordered (i.e. numbered) lists
These require start and end tags, and contain one or more LI elements representing individual list items.
DL definition lists
These require start and end tags and contain DT elements that give the terms, and DD elements that give corresponding definitions.
PRE preformatted text
Requires start and end tags. These elements are rendered with a monospaced font and preserve layout defined by whitespace and line break characters.
DIV document divisions
Requires start and end tags. It is used with the ALIGN attribute to set the text alignment of the block elements it contains. ALIGN can be one of LEFT, CENTER or RIGHT.
CENTER text alignment
Requires start and end tags. It is used to center text lines enclosed by the CENTER element. See DIV for a more general solution.
BLOCKQUOTE quoted passage
Requires start and end tags. It is used to enclose extended quotations and is typically rendered with indented margins.
FORM fill-out forms
Requires start and end tags. This element is used to define a fill-out form for processing by HTTP servers. The attributes are ACTION, METHOD and ENCTYPE. Form elements can't be nested.
ISINDEX primitive HTML forms
Not a container, so the end tag is forbidden. This predates FORM and is used for simple kinds of forms which have a single text input field, implied by this element.
HR horizontal rules
Not a container, so the end tag is forbidden. attributes are ALIGN, NOSHADE, SIZE and WIDTH.
TABLE can be nested
Requires start and end tags. Each table starts with an optional CAPTION followed by one or more TR elements defining table rows. Each row has one or more cells defined by TH or TD elements. attributes for TABLE elements are WIDTH, BORDER, CELLSPACING and CELLPADDING.


Lists

List items can contain block and text level items, although headings and address elements are excluded.

Unordered lists take the form:

  <UL>
    <LI> ... first list item
    <LI> ... second list item
    ...
  </UL>

The TYPE attribute can be used to set the bullet style on UL and LI elements.

Ordered (i.e. numbered) lists take the form:

  <OL>
    <LI> ... first list item
    <LI> ... second list item
    ...
  </OL>

The OL START attribute can be used to initialize the sequence number. You can reset it later on with the VALUE attribute on LI elements.

Definition lists take the form:

  <DL>
    <DT> term name
    <DD> term definition
    ...
  </DL>

DT elements can only act as containers for text level elements, while DD elements can hold block level elements as well, excluding headings and address elements.


Tables

These take the general form:

  <TABLE BORDER=3 CELLSPACING=2 CELLPADDING=2 WIDTH="80%">
  <CAPTION> ... table caption ... </CAPTION>
  <TR><TD> first cell <TD> second cell
  <TR> ...
  ...
  </TABLE>

The attributes on TABLE are all optional. By default, the table is rendered without a surrounding border. The table is generally sized automatically to fit the contents, but you can also set the table width using the WIDTH attribute. BORDER, CELLSPACING and CELLPADDING provide further control over the table's appearence. Captions are rendered at the top or bottom of the table depending on the ALIGN attribute.

Each table row is contained in a TR element, although the end tag can always be omitted. Table cells are defined by TD elements for data and TH elements for headers. Like TR, these are containers and can be given without trailing end tags. TH and TD support several attributes: ALIGN and VALIGN for aligning cell content, ROWSPAN and COLSPAN for cells which span more than one row or column. A cell can contain a wide variety of other block and text level elements including form fields and other tables.


Text level elements

These don't cause paragraph breaks. Text level elements that define character styles can generally be nested. They can contain other text level elements but not block level elements.

Font style elements

These all require start and end tags, e.g.

  This has some <B>bold text</B>.
TT teletype or monospaced text
I italic text style
B bold text style
STRIKE strike-through text style
BIG places text in a large font
SMALL places text in a small font
SUB places text in subscript style
SUP places text in superscript style

Phrase Elements

These all require start and end tags, e.g.

  This has some <EM>emphasized text</EM>.
EM basic emphasis typically rendered in an italic font
STRONG strong emphasis typically rendered in a bold font
DFN defining instance of the enclosed term
CODE used for extracts from program code
SAMP used for sample output from programs, and scripts etc.
KBD used for text to be typed by the user
VAR used for variables or arguments to commands
CITE used for citations or references to other sources

Form fields

INPUT, SELECT and TEXTAREA

INPUT elements are not containers and so the end tag is forbidden. INPUT, SELECT and TEXTAREA are only allowed within FORM elements. INPUT can be used for a variety of form fields including single line text fields, password fields, checkboxes, radio buttons, submit and reset buttons, hidden fields, file upload, and image buttons. SELECT elements require start and end tags and contain one or more OPTION elements. SELECT elements are used for single or multi-selection menus. TEXTAREA elements require start and end tags, and are used to define multi-line text fields. The content of the element is used to initialize the field.

Special Text level Elements

Anchors, IMG, APPLET, FONT, BR and MAP.

The A (anchor) element

Used to define hypertext links and also to define named locations for use as targets for hypertext links, e.g.

  The way to <a href="kamasutra.html">happiness</a>.

The attributes are: NAME, HREF, REL, REV and TITLE. HREF is used to supply a URL identifying the linked document or image etc. NAME is used to associate a name with this part of a document for use with URLs that target a named section of a document. Anchors can't be nested.

IMG

e.g.  <IMG SRC="canyon.gif" ALT="Grand Canyon">

Used to insert images. This is an empty element and so the end tag is forbidden. The attributes are: SRC, ALT, ALIGN, WIDTH, HEIGHT, BORDER, HSPACE, VSPACE, USEMAP and ISMAP. Images can be positioned vertically relative to the current textline or floated to the left or right. See BR with the CLEAR attribute for control over textflow.

APPLET

Requires start and end tags. This element is supported by all Java enabled browsers. It allows you to embed a Java applet into HTML documents, e.g. to include an animation. The contents of the element are used as a fallback if the applet can't be loaded. The attributes are: CODE, CODEBASE, NAME, ALT, ALIGN, WIDTH, HEIGHT, HSPACE and VSPACE. APPLET uses associated PARAM elements to pass parameters to the applet.

FONT

Requires start and end tags. This allows you to change the font size and/or color for the enclosed text. The attributes are: SIZE, COLOR and FACE. Colors are given as RGB in hexadecimal notation or as one of 16 widely understood color names. The FACE attribute is understood by some browsers and supports a comma separated list of font names.

BR

Used to force a line break. This is an empty element and so the end tag is forbidden. The CLEAR attribute can be used to move down past floating images on either margin, e.g. <BR CLEAR=LEFT>.

MAP

Requires start and end tags. This allows you to define client-side image maps. MAP elements contain one or more AREA elements that specify hotzones on the associated image and bind these hotzones to URLs.


W3C