6.4 Deprecated HTML Elements

6.4 Deprecated HTML Elements

The following elements used for formatting text should no longer be used. If you are displaying on older browsers that cannot interpret stylesheet languages, you may have to use them. Older HTML code may also contain these elements. The following elements have been deprecated:

<applet>

This element loads Java applets. Use the <object> element.

<basefont>

This element occurs in the <head> element and sets the font size of the document. It may be overridden by individual <font> elements in the document. Use stylesheets.

<center>

This element may be used to center text, tables, and images. Use stylesheets or as the attribute align="center" in other elements.

<dir>

List type element

<font>

Along with the common attributes (face, color, and size), this element changed the style of the text. Use stylesheets.

<isindex>

This element allows a single line input. Use <form> and <input type="text">.

<listing>

A type of text format

<menu>

A list type format

<s>, <strike>

Strikethrough font style. Use stylesheets.

In addition, the font styles big, small, b (bold), and i (italic) can be set with stylesheets. The attributes for size, bgcolor, color, and align may all be controlled with stylesheets. The attributes of the <body> element, such as alink, vlink, link, and text, can all be set with a stylesheet. Many other elements and attributes have been deprecated. If you use the elements found in XHTML Basic, you will have greater flexibility in choice of display devices. XHTML Basic is discussed later in this chapter.