HTML5 is the fifth and current major version of HTML. HTML5 introduced many new elements, attributes, and behaviors. While HTML5 also aimed to be backward-compatible with common parsing of older versions of HTML, many old attributes were deprecated.
The main reason these attributes were deprecated in HTML5 is to separate the concerns of content structure (HTML) and presentation (CSS). This is a fundamental principle of modern web design known as the separation of concerns, which provides multiple advantages:
Deprecated attributes are not guaranteed to be supported by all browsers, especially newer ones. This can lead to inconsistent behavior or appearance across different browsers.
To ensure the best user experience, deprecated attributes should not be used. This table lists the deprecated attributes this rule is checking for, and how to fix them.
| Attribute | Removed from | Fix |
|---|---|---|
|
|
Use the |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use the |
|
|
Use the |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use an HTTP |
|
|
Use the |
|
|
Use CSS |
|
|
Use the |
|
|
Use the |
|
|
Use the |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use |
|
|
Use script and a mechanism such as |
|
|
Use script and a mechanism such as |
|
|
Unnecessary. Omit it altogether |
|
|
Use script and a mechanism such as |
|
|
Repeat the |
|
|
Use DOM events mechanisms to register event listeners |
|
|
Use DOM events mechanisms to register event listeners |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Unnecessary. Omit it altogether |
|
|
use the |
|
|
Use CSS |
|
|
Use a progressive JPEG image (given in the |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use the HTTP OPTIONS feature instead |
|
|
Use the |
|
|
Omitting the |
|
|
Use CSS |
|
|
Use CSS |
|
|
Unnecessary. Omit it altogether |
|
|
Use CSS |
|
|
Use only one scheme per field, or make the scheme declaration part of the value |
|
|
Use |
|
|
Use CSS |
|
|
Use |
|
|
Use CSS |
|
|
Optimize the linked resource so that it loads quickly or, at least, incrementally |
|
|
|
|
|
Unnecessary. Omit it altogether |
|
|
Use CSS |
|
|
|
|
|
Specify the preferred persistent identifier using the |
|
|
Use the |
|
|
Use CSS |
|
|
|
|
|
Unnecessary. Omit it altogether |
|
|
Use CSS |
|
|
Use CSS |
|
|
Use CSS |
<table> <tr> <td width="50%">1st cell</td><!-- Noncompliant: 'width' attribute is deprecated --> <td width="50%">1st cell</td> </tr> </table>
<style>
.equal-width td { width: 50%; }
</style>
<table class="equal-width">
<tr>
<td>1st cell</td>
<td>2nd cell</td>
</tr>
</table>