Deprecated and Avoided Features
Category: htmlAn overview of deprecated and avoided features in HTML.
Deprecated Elements
Avoid these obsolete elements:
<font>– Use CSS<center>– Use CSS text-align<big>,<small>– Use CSS font-size (except<small>for fine print)<strike>,<s>– Use<del>or CSS<tt>– Use<code>or CSS<frame>,<frameset>– Use modern layout<marquee>,<blink>– Use CSS animations<applet>– Use<object>or modern JS
Avoid Inline JavaScript
<!-- ❌ Avoid -->
<button onclick="handleClick()">Click</button>
<a href="javascript:void(0)">Link</a>
<!-- ✅ Better -->
<button id="myButton">Click</button>
<script>
document.getElementById('myButton')
.addEventListener('click', handleClick);
</script>
Avoid Inline Styles
<!-- ❌ Avoid -->
<p style="color: red; font-size: 16px;">Text</p>
<!-- ✅ Better -->
<p class="error-text">Text</p>