This is a brief summary of the features of HTML 3.2 and should be used together with the full descriptions of each element.
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.
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.
The following draft specifications are still under revision, subject to final changes.
Additional materials will be provided giving greater details on each element.
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.
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, 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.
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.
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.
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>
The ADDRESS element is used for information about the author of the document. It requires start and end tags.
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.
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.
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.
These all require start and end tags, e.g.
This has some <B>bold text</B>.
These all require start and end tags, e.g.
This has some <EM>emphasized text</EM>.
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.
Anchors, IMG, APPLET, FONT, BR and MAP.
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.
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.
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.
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.
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>.
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.