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.
| Element | Description | Suggested Alternatives |
|---|---|---|
applet |
Inserts Java applet | Use the object element. |
basefont |
Sets default font size | Use a CSS rule such as:
|
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-through text style | If the strike-through represents deleted or removed text, use the Otherwise, use the |
u |
Underline text style | Use the text-decoration: underline; declaration in CSS. 1 |
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 |
|
Used to change the alignment of element contents | Use the (The |
alink |
body |
Used to set the color of selected links | Use a CSS rule such as:
|
background |
body |
Used to specify a texture tile for the document background. | Use the background property in CSS. |
bgcolor |
|
Used to specify the background color of the element | Use the background-color property in CSS. |
border |
|
Used to specify link border width | Use the (The |
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 Consider using two block level elements instead of a |
color |
|
Used to set the color of text | Use the color property in CSS. |
compact |
|
Used to reduce inter-item spacing | Use the display: compact; declaration in CSS. |
face |
|
Used to set the font type | Use the font or font-family properties in CSS. |
height |
|
Sets the height for the element | For table elements, use the Continue to use the |
hspace |
|
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:
|
noshade |
hr |
Flattens the aspect of the horizontal rule | Use a CSS rule that combines the
|
nowrap |
|
Used to suppress word wrap | Use the white-space: nowrap; declaration in CSS. |
size |
|
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
For fonts, use the
|
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 |
|
Used to set various list styles | Use the
|
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:
|
vspace |
|
Used to set vertical gutter around element | Use the margin property in CSS. |
width |
|
Used to set the width of elements | Use the Continue to use the |
| 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 If you are using italics for the title of a work, use the If you are using italics purely for presentation, consider using the |
b |
Used to identify text to be bolded | If the bolded text is meant to convey a strong emphasis, use the If you are using bold purely for presentation, consider using the |
big |
Used locally to make text larger | Consider using the For headings, use the |
small |
Used locally to make text smaller | |
blockquote |
Misapplied to indent text. | The To indent text for other reasons, use the |
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.