Eduzan / HTML
Deprecated Tags and Attributes
HTML evolves over time, and with each new version, certain tags and attributes are deprecated and eventually removed. Deprecated tags and attributes are those that are no longer recommended for use in modern web development because they have been replaced by more robust or semantically appropriate alternatives. Although older browsers might still support these deprecated features, it’s best practice to use the updated alternatives for better accessibility, performance, and compliance with current web standards.
Some attributes have been deprecated and replaced with CSS properties or other HTML elements that offer more flexibility and control.
2.1 Deprecated Attributes in Common Tags:
<table>Attributes (border,cellspacing,cellpadding):- Alternative: Use CSS to style tables.
<!-- Deprecated -->
<table border="1" cellspacing="5" cellpadding="10">
<tr><td>Content</td></tr>
</table>
<!-- Modern Alternative (CSS) -->
<table style="border: 1px solid black; border-spacing: 5px; padding: 10px;">
<tr><td>Content</td></tr>
</table>
2.<img>Attributes (border,align):- Alternative: Use CSS to style images.
<!-- Deprecated -->
<img decoding="async" src="image.jpg" border="0" align="left">
<!-- Modern Alternative (CSS) -->
<img decoding="async" src="image.jpg" style="border: none; float: left;">
3.<body>Attributes (bgcolor,text,link,vlink):- Alternative: Use CSS to set background color, text color, and link styles.
<!-- Deprecated -->
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#ff00ff">
<!-- Modern Alternative (CSS) -->
<body style="background-color: #ffffff; color: #000000;">
<style>
a:link {
color: #0000ff;
}
a:visited {
color: #ff00ff;
}
</style>End of lesson.