Versión en español




Deprecated tags and attributes in HTML


Deprecated tags and attributes are parts of the HTML standard code which use is no longer recommended. This happens because HTML standard is updated from time to time (e.g., from version 3.0 to 4.0) and some tags or characteristics of the language are added and others are removed or deprecated. By this, HTML authors are provided with more tools when a new element or attribute is added, and they are also recommended to discard those than have been replaced or became useless. The decision about use or not deprecated tags and/or attributes is left to each author consideration. Many browsers give support to deprecated elements, but in a future this may change. The general recommendation is to try other ways to achieve their effects.

Deprecated tags in HTML 4.01 are easily identified. Below is a list of the ten deprecated tags:

Tags deprecated in favor of Style Sheets:

Deprecated attributes varies from tag to tag. Most of them are presentational attributes and have been deprecated in favor of style sheets. This means that the same effect can be achieved by the use of the "id", "style" or "class" attributes in conjunction with style sheets. In the examples below we define two pieces of code that will be rendered exactly the same way, but using different methods.

Deprecated example using the HTML font tag:

Code begin<html>
<head>
<title>Deprecated example using the HTML font tag</title>
</head>
<body>
...<font face="Arial,helvetica" color="#0000FF">piece of text in blue</font>...
</body>
</html>Code end

Example using the "style" attribute:

Code begin<html>
<head>
<title>Example using the "style" attribute</title>
</head>
<body>
...<span style="font-family: arial,helvetica; color: #0000FF">piece of text in blue</span>...
</body>
</html>Code end

Example using classes defined with the HTML style tag:

Code begin<html>
<head>
<title>Example using classes defined with the HTML style tag</title>
<style type="text/css">
span.bluetext {font-family: arial,helvetica; color: #0000FF}
</style>
</head>
<body>
...<span class="bluetext">piece of text in blue</span>...
</body>
</html>Code end

For more information about Cascade Style Sheets, please consult our Cascade Style Sheets tutorial.



Bypass footer options  |   Send to a friend Send to a friend  |  Post to del.icio.us Post to del.icio.us

Digg this page Digg this!  |  File on Furl File on Furl  |  Add to Yahoo! MyWeb Add to Yahoo! MyWeb

Bypass W3C declarations | 

Valid XHTML 1.0 Strict  |  Valid CSS Why should you trust us? Click the images on the left to see how seriously we write our own pages, then make your choice.

Level Triple-A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0. This website gives its best effort to achieve the Level Triple-A Conformance, W3C-WAI Web Content Accessibility Guidelines 1.0. If you find any detail or error that we didn't see, don't hesitate and let us know.

The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect. -- Tim Berners-Lee, W3C Director and inventor of the World Wide Web.

 Link to us  |  Contact us  |  Beyond HTML  |  Tools and resources  |  Sitemap  |  Webmaster