Skip to Main Content >

IT Accessibility Curriculum and Resources

HTML 4.01 Deprecated Elements/Attributes and Better Solutions

For your convenience, we have compiled a list of elements and attributes that have been deprecated in HTML 4.01, along with some suggestions about better solutions for using these elements. We have also provided a list of usages that are not recommended.

Elements Deprecated in HTML 4.01
Element Description Suggested Alternatives
applet Inserts Java applet Use the object element.
basefont Sets default font size

Use a CSS rule such as:

html, body { font-size: 90%; }

center Aligns text or other elements centered within the margins Use the text-align: center; declaration in CSS.
dir Used to generate a multi-column list Use the ul (unordered list) element.
font Used to change font locally Use the font, font-family, or font-size properties in CSS.
isindex Creates a single-line input control Use the input element.
menu Used to generate a single column list Use the ul (unordered list) element.
  • strike
  • s
Strike-through text style

If the strike-through represents deleted or removed text, use the del element.

Otherwise, use the text-decoration: line-through; declaration in CSS.

u Underline text style Use the text-decoration: underline; declaration in CSS. 1

 

Attributes Deprecated in HTML 4.01
NOTE: Since the applet element is deprecated, all of the attributes used with it are also deprecated. To simplify this table, the applet attributes have not been included.
Attribute For Element(s) Description Suggested Alternatives
align
  • caption
  • iframe
  • img
  • input
  • object
  • legend
  • table
  • hr
  • div
  • h1-h6
  • p
Used to change the alignment of element contents

Use the text-align property in CSS.

(The align attribute is not deprecated for the following table elements: colgroup, col, thead, tfoot, tbody, tr, th, or td. Its use is discouraged when possible.)

alink body Used to set the color of selected links

Use a CSS rule such as:

a:active { color: #FF0000; }

background body Used to specify a texture tile for the document background. Use the background property in CSS.
bgcolor
  • table
  • tr
  • td
  • th
  • body
Used to specify the background color of the element Use the background-color property in CSS.
border
  • img
  • object
Used to specify link border width

Use the border property in CSS.

(The border attribute is not deprecated for the table element, but its use is discouraged.)

clear br Used to specify where the next line should appear in a visual browser after the line break

On the element after the line break, use the clear property in CSS.

Consider using two block level elements instead of a br element.

color
  • basefont
  • font
Used to set the color of text Use the color property in CSS.
compact
  • dl
  • ol
  • ul
  • dir
  • menu
Used to reduce inter-item spacing Use the display: compact; declaration in CSS.
face
  • font
  • basefont
Used to set the font type Use the font or font-family properties in CSS.
height
  • td
  • th
Sets the height for the element

For table elements, use the height property in CSS.

Continue to use the height attribute in (X)HTML for img and object elements.

hspace
  • img
  • object
Used to specify a horizontal gutter around the element Use the margin property in CSS.
language script Used to set a predefined script language name Use the type attribute to specify an Internet media type (such as type="text/javascript").
link body Used to set the color of links

Use a CSS rule such as:

a { color: #0000FF; }

noshade hr Flattens the aspect of the horizontal rule

Use a CSS rule that combines the color or background-color properties with the border-style: none; declaration. For example:

hr { color: #666666; border-style: none; }

nowrap
  • td
  • th
Used to suppress word wrap Use the white-space: nowrap; declaration in CSS.
size
  • hr
  • font
  • basefont
Used to set the size of these elements (measured in pixels for hr, measured in increments for font and basefont)

For horizontal rules, use the height property in CSS; for example:

hr { height: 10px; }

For fonts, use the font-size property in CSS; for example:

#navigation { font-size: 1.2em; }

start ol Used to set the starting point for an ordered list No suggested alternative. 2
text body Used to set body text color Use the color property in CSS.
type
  • li
  • ol
  • ul
Used to set various list styles

Use the list-style-type property in CSS. For example:

ul { list-style-type: square; }

ol { list-style-type: upper-roman; }

value li Used to reset sequence number No suggested alternative. 2
version html Used to specify version used Use a valid document type declaration (DTD).
vlink body Used to set the color of visited links

Use a CSS rule such as:

a:visited { color: #FF00FF; }

vspace
  • img
  • object
Used to set vertical gutter around element Use the margin property in CSS.
width
  • hr
  • td
  • th
  • pre
Used to set the width of elements

Use the width property in CSS.

Continue to use the width attribute in (X)HTML for img and object elements.

 

Element/Attribute Usage Discouraged for HTML 4.01
Element/ Attribute Discouraged Usage Description Suggested Alternatives
i Used to identify text to be italicized

If the italics are meant to convey an emphasis, use the em element. The semantic meaning is useful for visitors with screen readers and aural browsers.

If you are using italics for the title of a work, use the cite element.

If you are using italics purely for presentation, consider using the font-style: italic; declaration in CSS.

b Used to identify text to be bolded

If the bolded text is meant to convey a strong emphasis, use the strong element. The semantic meaning is useful for visitors with screen readers and aural browsers.

If you are using bold purely for presentation, consider using the font-weight: bold; declaration in CSS.

big Used locally to make text larger

Consider using the font-size property in CSS.

For headings, use the h1-h6 elements.

small Used locally to make text smaller
blockquote Misapplied to indent text.

The blockquote element should always contain quoted text.

To indent text for other reasons, use the padding or margin properties in CSS.

1 The cite element may also be an appropriate replacement for the deprecated u element in situations where you are identifying a book or other underlined title. Consider defining a class with a text-decoration: underline; declaration or a border-bottom property.

2 The CSS 2.1 Candidate Recommendation defines a counter-reset property, but it is not widely supported. If possible, consider structuring content so that ordered lists start at the first value.

Back to NYS Policy Home