Library of Congress Guidelines for HTML 4.01
[ HOME ] [ Introduction ] [ HTML Overview ] [ HTML 4.01 Tags ] [ Style Sheets ] [ Links ]

What's different about HTML 4.01?

Separation of Style from Structure

The basic difference between HTML 3.2 and the new HTML 4.01 is the separation of style from structure. You will notice that many of the presentational features from HTML 3.2 have been "deprecated" -- this means that they have been marked for eventual removal from the standard. In addition, all of the necessary linkages for style sheets have been added (new tags and universal attributes).

The good news is that when authors use HTML to markup a document's structure and style sheets to suggest the document's presentation, they can more easily achieve device-independence. So what's the bad news? Unfortunately, the browsers and the editors don't fully support the standard yet, therefore, most of these new features should be used with care.

Accessibility

The most significant step in HTML 4.01 to improve accessibility is the separation of stylistic presentation from the document structure. When HTML coding focuses on structure, a document is more adaptable to different browsing environments, more easily accommodating large fonts, special colors, speech synthesizers, and Braille tactile feedback devices.

HTML 4.01 also includes many new elements and attributes aimed at improving the Web's accessibility. The multi-dimensional nature of HTML tables has long posed problems for non-visual browsing, but new attributes for the <TABLE>, <TH>, and <TD> elements allow table summaries and a more explicit association between a cell and its header information. These attributes give non-visual browsers the ability to render a cell's header information, possibly in an abbreviated form, before giving the cell's content.

HTML 4.01 also makes forms more accessible adding new tags and attributes. The <FIELDSET> tag is used to group form controls together and the <LEGEND> element provides a caption for the "fieldset" group. This grouping process allows users with non-visual browsers to more easily navigate complex forms. In addition, the new <LABEL> tag is used to associate a text label with a form control so that users can more easily determine what information is required in a given field.

Other accessibility improvements include full image descriptions using the LONGDESC= attribute with the <IMG> tag, alternatives to images and videos through the <OBJECT> tag, and alternatives to image maps through a new content model for the <MAP> element.

Internationalization

HTML 4.01 has adopted the Universal Character Set as its character set. Previous versions of HTML were restricted to ISO-8859-1, which only handles some western European languages. The Universal Character Set is character-by-character equivalent to Unicode 2.0 and contains characters for almost all languages.

New attributes, LANG= (language identification) and DIR= (direction of text/script), can be used with most HTML 4.01 tags (although they aren't universally supported by the browsers). In addition, the <BDO> tag allows authors to override the bidirectional algorithm used when right-to-left text such as Hebrew is presented. HTML 4.01 also offers new special character entities for easy entry of mathematical symbols, Greek letters, and more.

Style Sheets

HTML 4.01 adds tags and attributes for the use of style sheets. Currently, the only universal support among the browsers is for Cascading Style Sheets, version 1 (CSS1), and even so, that support is spotty.

The new ID=, CLASS=, and STYLE= attributes allow style information to be attached to specific tags. The <LINK> and <STYLE> tags have new TYPE= and MEDIA= attributes for specifying the style sheet language and output media (screen, printer, voice, etc.), respectively.

Client-side Scripting

HTML 4.01 has added many enhancements in support of client-side scripting. The <SCRIPT> element now includes attributes for specifying the scripting language, embedding an external script, and deferring execution of a script. As well, a number of attributes have been added to trigger the execution of a script after an "event," such as clicking an element, pressing a key, mouseovers, or changing a value in a form.

Also new in HTML 4.01, the <NOSCRIPT> element allows for alternate content for browsers with client-side scripting disabled or not supported.

Frames

Although "frames" are a part of the HTML 4.01 standard, the frames model is not changed from the flawed frames model originally proposed by Netscape. Therefore, we continue to discourage the use of frames for Library of Congress pages, unless there is an extremely compelling reason they are needed.

Advanced Tables

The simple table model of HTML 3.2 is expanded in HTML 4.01 to include row and column groups, greater flexibility in defining a table's rules, and accessibility improvements.

The use of row groups through the <THEAD>, <TFOOT>, and <TBODY> tags, improves the readability of tables by allowing visual browsers to render static header and footer rows with scrollable body rows. However, these tags are not yet well supported in the browsers.

The HTML 4.01 Tag Set

The actual HTML 4.01 Tag Set is not significantly different from the previous version (HTML 3.2). Although some new tags have been added, many of them are not supported by the browsers. The most important and currently usable feature of HTML 4.01 is Cascading Style Sheet language.

New Tags

Although there are 24 new HTML tags in version 4.01, most of these tags are still not supported by Netscape version 4, while many more are supported by Internet Explorer, versions 4 and 5. The new tags in HTML 4.01 are:

* Please note: the use of frames on the LC Web site is highly discouraged. Proper frames coding is very complex and hard to manage. In addition, frames can present usability issues for some user communities and can prevent all users from being able to bookmark your pages.

However, there are exceptional cases when some minor use of frames is the best way to render and present the data. In those cases, it is imperative that a non-frames version of the information be available (by link) as well as indicated in the <NOFRAMES>...</NOFRAMES> container. In addition, the <!DOCTYPE...> tag for frame set documents must also be used.

Deprecated Elements

The tags and attributes listed below are being "deprecated," or gradually phased out, and are followed by a description of the newer tags or techniques replacing them. Although they still may be used with the HTML 4.01 "transitional" DTD, it is still recommended that Library of Congress Web page designers try to stop using in favor of the recommended methods described below.

Deprecated Tags

Deprecated Attributes

Almost all attributes that specify the presentation of an HTML document (e.g., colors, alignment, fonts, graphics, etc.) have been deprecated in favor of style sheets. All attributes of the BODY tag are deprecated in favor of style settings for background, text, link, visited link, active link colors. The following attributes have been deprecated in HTML 4.01.

ALIGN=
Used to center, right, or left align text within certain HTML elements. Use style sheets for alignment instead. exceptions: <COL>, <COLGROUP>, <TBODY>, <TD>, <TFOOT>, <TH>, <THEAD>, <TR>
ALINK=
Used in the body tag to assign a color to the "active link." Define this value using the "pseudo-class" A.ACTIVE in styles sheets instead.
BACKGROUND=
Used with the BODY tag to set a background graphic for the entire screen. Use style sheets instead.
BGCOLOR=
Used to set background color; deprecated for all tags. Use style sheets instead.
BORDER=
Link border width for the <IMAGE> and <OBJECT> tags. Use style sheets instead.
CLEAR=
Used with the <BR> tag to determine text flow around images.
COLOR=
Used to set font color. Use style sheets instead.
COMPACT
Used to make lists more compact. Use style sheets to set this for individual tags or classes.
FACE=
Used to set the font face. Use style sheets to set this for individual tags or classes.
HEIGHT=
For a table cell. Use style sheets instead.
HSPACE=
Horizontal space around images, etc. Use style sheets instead.
LANGUAGE=
Used with the <SCRIPT> tag to set a predefined scripting language.
LINK=
Used to set the link color. Use the "pseudo-class" A.LINK in style sheets.
NOSHADE
Changes the appearance of the <HR> tag. Use style sheets instead.
NOWRAP
Suppresses word-wrap. Use style sheets instead.
PROMPT=
Used with <ISINDEX> to set a prompt. Since <ISINDEX> is deprecated, so is the PROMPT attribute.
SIZE=
Only deprecated for the <HR>, <FONT>, and <BASEFONT> tags. Still in use with the forms tags <INPUT> and <SELECT>.
START=
Starting number for the list items in <OL> (ordered lists).
TEXT=
Sets the text color in the <BODY> tag. Use style sheets instead.
TYPE=
Used with list tag sets to set the style of numbering or bulleting. Set this using style sheets.
VALUE=
Used to reset the numbering sequence in ordered lists.
VERSION=
Deprecated for the HTML tag. Use the <!DOCTYPE> to indicate HTML version and DTD information.
VLINK=
Used to set the visited link color in the <BODY> tag. Set this using style sheets.
VSPACE=
Used to set vertical spacing with the <IMAGE>, <APPLET>, and <OBJECT> tags.
WIDTH=
Only deprecated for the <HR>, <APPLET>, <TD>, <TH>, and <PRE> tags. Still in use with the <IFRAME>,< IMAGE>, <OBJECT>, <TABLE>, <COL>, and <COLGROUP> tags.

Obsolete Tags

Version 4.01 also officially deletes a few relatively uncommon HTML tags, which could cause problems if the new browsers hew strictly to the 4.01 specification.

<XMP>, <PLAINTEXT>, and <LISTING> all display certain aspects of text placement--such as line breaks and spacing--as they appear in the HTML source document (for example, if you wanted to avoid HTML's automatic wrapping). Use the <PRE> tag instead.

HTML 4.01 Common Attributes

For detailed descriptions of the HTML 4.01 Common Attributes, select the links below.

Core Attributes

CLASS=
The CLASS attribute specifies the element to be a member of one or more classes. Classes allow authors to define specific kinds of a given element. The CLASS attribute is generally used to apply "style" rules to one or more elements.
ID=
The ID attribute uniquely identifies an element within a document. No two elements can have the same ID value in a single document. Also used to associate "style" rules for that unique element. Most browsers do not fully support the ID attribute for internal linking; continue to use <a name=...>.
STYLE=
The STYLE attribute allows authors to specify style rules inline for a single occurrence of an element.
TITLE=
The TITLE attribute provides a title for an element and is commonly implemented as a "tooltip" on visual browsers, though many browsers lack support for TITLE.

Internationalization

LANG=
The LANG attribute specifies the language of an element's attribute values and its content, including all contained elements that do not specify their own LANG attribute. While the LANG attribute is not widely supported, its use may help search engines index a document by its language while allowing speech synthesizers to use language-dependent pronunciation rules.
DIR=
The DIR attribute specifies the directionality of text--left-to-right (DIR=ltr, the default) or right-to-left (DIR=rtl).

Scripting

A number of attributes that define client-side scripting events are common to most elements. The attribute value is a script--typically a function call or a few short statements--that is executed when the event occurs. The value may contain entities (e.g., &quot;).

ONCLICK=
when the mouse button is clicked on an element;
ONDBLCLICK=
when the mouse button is double-clicked on an element
ONMOUSEDOWN=
when the mouse button is pressed over an element
ONMOUSEUP=
when the mouse button is released over an element
ONMOUSEOVER=
when the mouse is moved onto an element
ONMOUSEMOVE=
when the mouse is moved while over an element
ONMOUSEOUT=
when the mouse is moved away from an element
ONKEYPRESS=
when a key is pressed and released over an element
ONKEYDOWN=
when a key is pressed down and held over an element
ONKEYUP=
when a key is released over an element

The HTML 4.01 Tag Set

The HTML 4.01 Full Tag Set is listed below organized by function rather than alphabetically. For a full description, with examples of tag usage, select the hypertext link for each individual element. Links take advantage of excellent existing documentation already on the Web for the Web Design Group's HTMLHelp site. At the bottom of each entry on that site, a link is provided back to the World Wide Web Consortium site. Deprecated elements are displayed with the legend -- deprecated -- and should be avoided. Use the menu below to jump quickly to a functional section.

High-Level Structural Tags

Head Container Tags

Generic Block-level Elements

Lists

Tables

Forms

Special Inline Elements

Phrase Elements

Font Style Elements

Frames


[ HOME ] [ Introduction ] [ HTML Overview ] [ HTML 4.01 Tags ] [ Style Sheets ] [ Links ]
[ Library of Congress Standards ] [ Library of Congress Home Page ]

Library of Congress
Library of Congress Help Desk (January 25, 2001)

Maintained by the Network Development and MARC Standards Office
Links to detailed documentation on Web Design Group site are provided.