Deprecated HTML Tags and Alternatives Guide

Deprecated HTML Tags Image

What are the deprecated tags? Deprecated tags are those that have been replaced by newer tags or flexible alternative. Deprecated tags are declared as deprecated in HTML4 by the W3C.

The web browsers are still support deprecated tags and attributes but eventually these tags are likely to become obsolete. You can use this tool to check for deprecated tags. If you found any of them, you should replace it with appropriate tags.

The following table is a list of deprecated tags and their replacement:

Deprecated Replacement Description
<applet> <object> insert applet
<basefont> font in CSS style set font styles
<center> <div style="text-align:center;"> center elements
<dir> <ul> directory list
<font> font in CSS style applie font styles
<isindex> <form> add search field
<menu> <ul> menu list
<s> text-decoration in CSS style strike through
<strike> text-decoration in CSS style strike through
<u> text-decoration in CSS style underline
<embed> <object> embed an application in a document
<listing> <pre> specify listing of items
<plaintext> <pre> specify plaintext
<xmp> <pre> specify preformatted text

There are many attributes have been deprecated in HTML4. See the following table for detail and their alternatives.

Attribute Deprecated in Tag Alternative in CSS
align

<caption>
<div>
<hr>
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<img>
<p>
<table>

text-align
alink <body> a:active { color: }
background <body> background-image
bgcolor <body>
<table>
<td>
<th>
<tr>
background-color
border <img>
<object>
border
clear <br> clear
color <basefont>
<font>
color
compact <dl>
<ol>
<ul>
<dir>
<menu>
display: compact;
face <basefont>
<font>

font or font-family

height

<td>
<th>
height
hspace <img>
<object>
margin
link <body> a {
color:
}
noshade <hr> hr {
color:
border-style:
}
nowrap <td>
<th>
white-space: nowrap;
size <basefont>
<font>
<hr>
font-size
height
start <ol> counter-reset
text <body> color
type <li>
<ol>
<ul>
ol { list-style-type: }
ul { list-style-type: }
value <li> counter-reset
vlink <body> a:visited { color: }
vspace <img>
<object>
margin
width <hr>
<pre>
<td>
<th>
width