Deprecated Attributes

A large number of attributes are deprecated in HTML 4.0, primarily due to the preference given to style sheets over direct content formatting. Browsers will continue to honor these deprecated attributes for a long time to come, but if you eventually design content exclusively for browsers that are HTML 4.0 compatible, you should use that project as a starting point for weaning yourself from these deprecated attributes. Table 7.4 lists all the deprecated attributes in HTML 4.0, plus the affected elements and suggested replacement syntax. In some instances, you will see a deprecated attribute associated with a new element (like the deprecated ALIGN attribute of the new IFRAME element). This is not a trick. You can still use the “old” attribute with a new element for the sake of authoring-style compatibility.

Table 7-4. Deprecated Attributes in HTML 4.0

Attribute

Elements

Supplanted By

ALIGN
CAPTION, APPLET, IFRAME, IMG, INPUT, OBJECT, LEGEND, TABLE, HR, DIV, H1-H6, P

text-align and vertical-align style attributes

ALINK
BODY

A:active {color:}

ALT
APPLET

OBJECT element TITLE attribute

ARCHIVE
APPLET

OBJECT element ARCHIVE attribute

BACKGROUND
BODY

background style attribute

BGCOLOR
BODY, TABLE, TD, TH, TR

background-color style attribute

BORDER
IMG, OBJECT

border-width style attributes

CLEAR
BR

clear style attribute

CODE
APPLET

OBJECT element CLASSID attribute

CODEBASE
APPLET

OBJECT element CODEBASE attribute

COLOR

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.